This is an archive of the discontinued LLVM Phabricator instance.

[PowerPC] Support ppc-asm-full-reg-names for AIX
ClosedPublic

Authored by qiucf on Jan 7 2021, 7:14 PM.

Details

Summary

This restriction was introduced in D39016.

Diff Detail

Event Timeline

qiucf created this revision.Jan 7 2021, 7:14 PM
qiucf requested review of this revision.Jan 7 2021, 7:14 PM
Herald added a project: Restricted Project. · View Herald TranscriptJan 7 2021, 7:14 PM
steven.zhang added inline comments.Jan 7 2021, 11:32 PM
llvm/lib/Target/PowerPC/MCTargetDesc/PPCInstPrinter.cpp
599
bool PPCInstPrinter::showRegistersWithPercentPrefix(const char *RegName) const {
  if (!FullRegNamesWithPercent || TT.getOS() == Triple::AIX)
    return false;

Could you please double confirm on why we need this check for AIX.

Historically, the letter prefixes were always stripped out because AIX and Linux assemblers don't accept them. The mentioned patch added the ability to produce prefixes with percent sign and letter which is actually accepted by the Linux assembler (GNU as). It was thought (not known) at the time that AIX does not accept this %<letter> syntax either so the guard for AIX was kept. If you can confirm that the AIX system assembler accepts this syntax, then this is fine.

I suppose it is fine either way since we never took the extra step of making -ppc-reg-with-percent-prefix the default, but if we do choose to make that the default at some point, we can only do so if the AIX assembler also supports it.

qiucf added a comment.Jan 17 2021, 7:28 PM

Historically, the letter prefixes were always stripped out because AIX and Linux assemblers don't accept them. The mentioned patch added the ability to produce prefixes with percent sign and letter which is actually accepted by the Linux assembler (GNU as). It was thought (not known) at the time that AIX does not accept this %<letter> syntax either so the guard for AIX was kept. If you can confirm that the AIX system assembler accepts this syntax, then this is fine.

I suppose it is fine either way since we never took the extra step of making -ppc-reg-with-percent-prefix the default, but if we do choose to make that the default at some point, we can only do so if the AIX assembler also supports it.

Thanks for the historical information. I saw GNU as on AIX supports -mregnames/-mno-regnames and accepts assembly with regname or precent prefixes, but did not found any such option from AIX system assembler. And LLVM MC assembler also doesn't work since AsmParser for XCOFF is not ready yet.

jsji accepted this revision as: jsji.Oct 13 2021, 11:38 AM

I think we should enable this for lit testing purpose.

The options (-ppc-asm-full-reg-names, -ppc-reg-with-percent-prefix) are not on by default, so it won't cause problem by default.
If user add this option explicitly, then most of the time it should be for debug or lit testing.

We can add one warning on AIX when the option is on, mentioning that showing full reg names won't be accepted by default AIX assembler for now, just for reading or lit purpose.

This revision is now accepted and ready to land.Oct 13 2021, 11:38 AM
This revision was automatically updated to reflect the committed changes.
nemanjai added inline comments.Oct 26 2021, 4:18 AM
llvm/test/CodeGen/PowerPC/builtins-ppc-xlcompat-sync-64.ll
7 ↗(On Diff #379914)

We can probably get rid of the --check-prefix here since the AIX asm should match the Linux asm, won't it?