This is an archive of the discontinued LLVM Phabricator instance.

[NFC] [PowerPC] Determine Endianness in PPCTargetMachine
ClosedPublic

Authored by gandhi21299 on Mar 15 2021, 5:53 PM.

Details

Summary

Added a member in PPCTargetMachine class which stores the endianness of the target. The endianness is detected from triple which is passed into the static function getDataLayoutString().

Diff Detail

Event Timeline

gandhi21299 created this revision.Mar 15 2021, 5:53 PM
gandhi21299 requested review of this revision.Mar 15 2021, 5:53 PM
Herald added a project: Restricted Project. · View Herald TranscriptMar 15 2021, 5:53 PM
nemanjai accepted this revision.Mar 15 2021, 8:25 PM

LGTM (after the clang-format nits are addressed). Thanks for fixing this. Also, please mark this as [NFC] since there are no functional changes and make the title more descriptive. Perhaps:
[NFC][PowerPC] Determine endianness in PPCTargetMachine

This revision is now accepted and ready to land.Mar 15 2021, 8:25 PM

Sounds good! Thanks for reviewing @nemanjai

gandhi21299 retitled this revision from Resolved a FIXME in PowerPC SubTarget to [NFC] [PowerPC] Determine Endianness in PPCTargetMachine.Mar 15 2021, 8:41 PM

applying clang-format

Please commit this patch at your convenience, thank you. @nemanjai

Can someone who has commit access, commit this patch? Thanks

Can someone who has commit access, commit this patch? Thanks

Sorry for the delay. Will commit today.

As it turns out, this can't be committed as-is. The initialization order is incorrect. We compute the endianness while initializing the base class, but the data member is part of the derived class and the default initialization happens afterwards. I'll fix it up and commit it.

This revision was landed with ongoing or failed builds.Mar 19 2021, 6:22 PM
This revision was automatically updated to reflect the committed changes.

A couple of notes:

  • Please test all patches for PPC on a PPC machine. If you don't have access, please reach out to me and I'll provide access to one on an OSU/OSL machine.
  • When running clang-format, please run it only on the code you changed. You can do this using git clang-format (you can find the details at https://llvm.org/docs/Contributing.html#how-to-submit-a-patch)