[PATCH] D27231: [PowerPC] Fix logic dealing with nop after calls (and tail-call eligibility)

Kyle Butt via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Dec 20 17:42:09 PST 2016


iteratee added a comment.

I found what was causing our tests to fail.



================
Comment at: llvm/trunk/lib/Target/PowerPC/PPCISelLowering.cpp:4017
-  // we treat it as in different module.
-  if (RelMod == Reloc::PIC_ && GV->hasDefaultVisibility())
     return false;
----------------
This line has to remain for the code to be correct, but it's overly broad. The correct line is:

if (TM.getRelocationModel() == Reloc::PIC_ &&
      GV->hasDefaultVisibility() &&
      !GV->hasLocalLinkage())
    return false;

See PPCSubtarget::classifyGlobalReference in PPCSubtarget.cpp

under PIC, any non-local global is interposable, and so the linker will insert a trampoline for those calls.

I'll verify that this fixes the broken test, but it fixes the testcase I extracted.


Repository:
  rL LLVM

https://reviews.llvm.org/D27231





More information about the llvm-commits mailing list