[PATCH] D77429: [AsmPrinter] Do not define local aliases for global objects in a comdat
Leonard Chan via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Mon Apr 6 14:11:56 PDT 2020
This revision was automatically updated to reflect the committed changes.
Closed by commit rGa0222ac1f9c2: [AsmPrinter] Do not define local aliases for global objects in a comdat (authored by leonardchan).
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D77429/new/
https://reviews.llvm.org/D77429
Files:
llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
llvm/test/CodeGen/X86/semantic-interposition-comdat.ll
Index: llvm/test/CodeGen/X86/semantic-interposition-comdat.ll
===================================================================
--- /dev/null
+++ llvm/test/CodeGen/X86/semantic-interposition-comdat.ll
@@ -0,0 +1,23 @@
+; RUN: llc -mtriple x86_64-unknown-linux-gnu %s -o - | FileCheck %s
+
+$comdat_func = comdat any
+
+; CHECK-LABEL: func2:
+; CHECK-NEXT: .Lfunc2$local
+
+declare void @func()
+
+define hidden void @func2() {
+entry:
+ call void @func()
+ ret void
+}
+
+; CHECK: comdat_func:
+; CHECK-NOT: .Lcomdat_func$local
+
+define hidden void @comdat_func() comdat {
+entry:
+ call void @func()
+ ret void
+}
Index: llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
===================================================================
--- llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
+++ llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
@@ -460,7 +460,7 @@
// assumed it.
if (TM.getTargetTriple().isOSBinFormatELF() &&
GlobalObject::isExternalLinkage(GV.getLinkage()) && GV.isDSOLocal() &&
- !GV.isDeclaration() && !isa<GlobalIFunc>(GV))
+ !GV.isDeclaration() && !isa<GlobalIFunc>(GV) && !GV.hasComdat())
return getSymbolWithGlobalValueBase(&GV, "$local");
return TM.getSymbol(&GV);
}
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D77429.255487.patch
Type: text/x-patch
Size: 1214 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200406/747b6966/attachment.bin>
More information about the llvm-commits
mailing list