based on http://reviews.llvm.org/D13481 - Call locally defined function directly for PIE
Details
Diff Detail
- Repository
- rL LLVM
Event Timeline
Can you add a test for other linkages as Rafael asked?
This is still missing a testcase for other linkages (weak_odr and weak at least).
I would test internal, weak, and weak_odr. Include them even if they generate calls through the PLT.
../llvmOrg/lib/Target/X86/X86Subtarget.cpp | ||
---|---|---|
148 ↗ | (On Diff #54072) | ditto, run the formatter |
../llvmOrg/lib/Target/X86/X86Subtarget.h | ||
559 ↗ | (On Diff #54072) | Is this parameter really necessary? I expect you can remove it, even if you have to change a few test expectations. |
561 ↗ | (On Diff #54072) | Run clang-format |
../llvmOrg/lib/Target/X86/X86Subtarget.h | ||
---|---|---|
559 ↗ | (On Diff #54072) | I can remove isFast flag but in case it's called from "fastLowerCall" and the return value is "MO_GOTPCREL" I will need to reset it back to zero. do you think we should handle it in the fast path? |
Minor issues, I think this is basically ready
../llvmOrg/lib/Target/X86/X86Subtarget.h | ||
---|---|---|
559 ↗ | (On Diff #54171) | Changing fastLowerCall seems nice, it keeps the complexity of what FastISel does local to itself. |
../llvmOrg/test/CodeGen/X86/pie.ll | ||
7 ↗ | (On Diff #54171) | Should this be foo{{$}}? |
9 ↗ | (On Diff #54171) | Interesting. I would've expected a PLT call for such weak functions so that they can be provided by libraries, but it seems you cannot override a non-ODR weak function from an executable with GCC. GCC generates a direct, non-PLT call in non-PIE mode, and a PLT call with -fPIE. I'm guessing they just don't do this optimization yet. |