This is an archive of the discontinued LLVM Phabricator instance.

[PowerPC][MC] Set 'future' as default CPU type of AIX
ClosedPublic

Authored by qiucf on Jul 12 2023, 8:07 AM.

Details

Summary

For 64-bit Power on Linux (both LE and BE), ELFObjectFile returns 'future' as default CPU type if mcpu is not specified, so that all necessary features will be enabled in MC.

While for XCOFF, the default CPU type is always null, which makes tools like llvm-objdump not able to recognize prefixed instructions, unless specifying --mcpu=pwr10 or --mattr=+prefix-instrs manually.

Diff Detail

Event Timeline

qiucf created this revision.Jul 12 2023, 8:07 AM
Herald added a project: Restricted Project. · View Herald TranscriptJul 12 2023, 8:07 AM
Herald added a subscriber: hiraditya. · View Herald Transcript
qiucf requested review of this revision.Jul 12 2023, 8:07 AM
Herald added a project: Restricted Project. · View Herald TranscriptJul 12 2023, 8:07 AM
nemanjai accepted this revision.Jul 12 2023, 8:48 AM

LGTM. Whatever the choice is wrt. 32-bit mode, please just add a comment to the function explaining it.

llvm/lib/Object/XCOFFObjectFile.cpp
1223

Why do we restrict this to 64-bit? Just because we do the same for ELF?

This revision is now accepted and ready to land.Jul 12 2023, 8:48 AM
qiucf added a subscriber: MaskRay.Jul 12 2023, 8:58 AM
qiucf added inline comments.
llvm/lib/Object/XCOFFObjectFile.cpp
1223

Yes. I'm also not sure is there some specific reason why PPC ELF does this only for 64-bit (since added by D127824, maybe @MaskRay ). After I tested things on 32-bit is okay, the 64-bit constraint will be removed.

MaskRay added inline comments.Jul 12 2023, 1:32 PM
llvm/lib/Object/XCOFFObjectFile.cpp
1223

Thanks for the suggestion.

I think I restricted D155089 to 64-bit because I didn't test the 32-bit behavior.. I sent https://reviews.llvm.org/D155114 to extend the behavior to 32-bit.

qiucf updated this revision to Diff 539825.Jul 12 2023, 7:14 PM

Support XCOFF32

This revision was landed with ongoing or failed builds.Jul 12 2023, 7:17 PM
This revision was automatically updated to reflect the committed changes.