This is an archive of the discontinued LLVM Phabricator instance.

[AIX] Minor cleanup in AsmPrinter. [NFC]
ClosedPublic

Authored by sfertile on Jan 21 2020, 8:56 AM.

Details

Summary
  • Extends the comments related to function descriptors, noting how they are only used on AIX.
  • Changes the condition used to gate the creation of the current function symbol in AsmPrinter::SetupMachineFunction to reflect being AIX specific. The creation of the symbol is different because of AIXs linkage conventions, not because AIX uses function descriptors.

Diff Detail

Event Timeline

sfertile created this revision.Jan 21 2020, 8:56 AM
Herald added a project: Restricted Project. · View Herald TranscriptJan 21 2020, 8:56 AM
Herald added a subscriber: hiraditya. · View Herald Transcript
MaskRay accepted this revision.Jan 21 2020, 10:06 AM
This revision is now accepted and ready to land.Jan 21 2020, 10:06 AM
Xiangling_L added inline comments.Jan 21 2020, 3:10 PM
llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
670

s/functions/function?

671

I kinda feel this comment is a little misleading. The linkage of function descriptor symbol and function entry point symbol must be same all the time, no matter the linkage is internal or not. This comment here seems imply that If the function linkage is internal, then the function descriptor symbol can have different linkage as the function symbol.? And I vaguely recall that why we choose to omit .lglobl foo{DS} when foo is internal is because by default, for csect name, it would be .lglobl linkage if we don't explicitly set '.globl as assembler manual state:

The assembler automatically generates the symbol table entry for any csect name with a class of C_HIDEXT unless there is an
explicit .globl pseudo-op applied to the csect name.

Please correct me if I am wrong.

hubert.reinterpretcast added inline comments.
llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
670

The most clear would be "function's".

1664

s/functions/function's/;

sfertile marked an inline comment as done.Jan 22 2020, 10:01 AM
sfertile added inline comments.
llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
671

Thanks, You are right. If we can always emit the linkage why not do so? I understand its redundant because the default is correct anyway, but it slightly simplifies the code.

This revision was automatically updated to reflect the committed changes.

This change regresses a whole bunch of lit tests when running on AIX, which change just the march and then stumble into the assert(MAI->needsFunctionDescriptors() && "AIX ABI is descriptor based.");, for example test/CodeGen/XCore/section-name.ll. Perhaps this should live in the PPC target printer instead?

Sorry about that David. I've posted https://reviews.llvm.org/D74622 to revert back to using the MCASmInfo hook as the check.