[all-commits] [llvm/llvm-project] 80e2fc: [X86][ELF] Prefer lowering MC_GlobalAddress operan...
bd1976bris via All-commits
all-commits at lists.llvm.org
Thu Sep 17 04:26:29 PDT 2020
Branch: refs/heads/release/11.x
Home: https://github.com/llvm/llvm-project
Commit: 80e2fc1e6e68d6ed57dccc03c6a5121e216bfd43
https://github.com/llvm/llvm-project/commit/80e2fc1e6e68d6ed57dccc03c6a5121e216bfd43
Author: Ben Dunbobbin <Ben.Dunbobbin at sony.com>
Date: 2020-09-17 (Thu, 17 Sep 2020)
Changed paths:
M llvm/lib/IR/Globals.cpp
M llvm/test/CodeGen/AArch64/emutls.ll
M llvm/test/CodeGen/ARM/emutls.ll
M llvm/test/CodeGen/X86/2008-03-12-ThreadLocalAlias.ll
M llvm/test/CodeGen/X86/linux-preemption.ll
M llvm/test/CodeGen/X86/semantic-interposition-comdat.ll
M llvm/test/CodeGen/X86/tailcallpic1.ll
M llvm/test/CodeGen/X86/tailcallpic3.ll
M llvm/test/CodeGen/X86/tailccpic1.ll
Log Message:
-----------
[X86][ELF] Prefer lowering MC_GlobalAddress operands to .Lfoo$local for STV_DEFAULT only
This patch restricts the behaviour of referencing via .Lfoo$local
local aliases, introduced in https://reviews.llvm.org/D73230, to
STV_DEFAULT globals only.
Hidden symbols via --fvisiblity=hidden (https://gcc.gnu.org/wiki/Visibility)
is an important scenario.
Benefits:
- Improves the size of object files by using fewer STT_SECTION symbols.
- The code reads a bit better (it was not obvious to me without going
back to the code reviews why the canBenefitFromLocalAlias function
currently doesn't consider visibility).
- There is also a side benefit in restoring the effectiveness of the
--wrap linker option and making the behavior of --wrap consistent
between LTO and normal builds for references within a translation-unit.
Note: this --wrap behavior (which is specific to LLD) should not be
considered reliable. See comments on https://reviews.llvm.org/D73230
for more.
Differential Revision: https://reviews.llvm.org/D85782
(cherry picked from commit 4cb016cd2d8467c572b2e5c5d34f376ee79e4ac1)
More information about the All-commits
mailing list