[llvm] r337338 - CodeGen: Don't create address significance table entries for thread-local variables.
Peter Collingbourne via llvm-commits
llvm-commits at lists.llvm.org
Tue Jul 17 17:21:41 PDT 2018
Author: pcc
Date: Tue Jul 17 17:21:40 2018
New Revision: 337338
URL: http://llvm.org/viewvc/llvm-project?rev=337338&view=rev
Log:
CodeGen: Don't create address significance table entries for thread-local variables.
The presence of these symbols in the symbol table can cause symbol type
mismatch errors (or undefined symbol errors on emulated TLS targets)
and they can't be ICF'd anyway.
Modified:
llvm/trunk/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
llvm/trunk/test/CodeGen/X86/addrsig.ll
Modified: llvm/trunk/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/AsmPrinter/AsmPrinter.cpp?rev=337338&r1=337337&r2=337338&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/AsmPrinter/AsmPrinter.cpp (original)
+++ llvm/trunk/lib/CodeGen/AsmPrinter/AsmPrinter.cpp Tue Jul 17 17:21:40 2018
@@ -1533,7 +1533,8 @@ bool AsmPrinter::doFinalization(Module &
// Emit address-significance attributes for all globals.
OutStreamer->EmitAddrsig();
for (const GlobalValue &GV : M.global_values())
- if (!GV.getName().startswith("llvm.") && !GV.hasAtLeastLocalUnnamedAddr())
+ if (!GV.isThreadLocal() && !GV.getName().startswith("llvm.") &&
+ !GV.hasAtLeastLocalUnnamedAddr())
OutStreamer->EmitAddrsigSym(getSymbol(&GV));
}
Modified: llvm/trunk/test/CodeGen/X86/addrsig.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/addrsig.ll?rev=337338&r1=337337&r2=337338&view=diff
==============================================================================
--- llvm/trunk/test/CodeGen/X86/addrsig.ll (original)
+++ llvm/trunk/test/CodeGen/X86/addrsig.ll Tue Jul 17 17:21:40 2018
@@ -25,6 +25,9 @@ declare void @f3() unnamed_addr
; CHECK-NOT: .addrsig_sym g3
@g3 = external unnamed_addr global i32
+; CHECK-NOT: .addrsig_sym tls
+ at tls = thread_local global i32 0
+
; CHECK: .addrsig_sym a1
@a1 = alias i32, i32* @g1
; CHECK-NOT: .addrsig_sym a2
More information about the llvm-commits
mailing list