Revert "ThinLTO: Fix inline assembly references to static functions with CFI"
authorSami Tolvanen <samitolvanen@google.com>
Fri, 16 Jul 2021 21:47:19 +0000 (14:47 -0700)
committerSami Tolvanen <samitolvanen@google.com>
Fri, 16 Jul 2021 21:47:33 +0000 (14:47 -0700)
This reverts commit 8e3b5cb39eef462943ed7556469604ce25c07a1d.

Reverting to investigate test failures.

llvm/lib/Transforms/IPO/ThinLTOBitcodeWriter.cpp
llvm/test/ThinLTO/X86/devirt2.ll
llvm/test/Transforms/ThinLTOBitcodeWriter/cfi-icall-static-inline-asm.ll [deleted file]
llvm/test/Transforms/ThinLTOBitcodeWriter/split-internal2.ll
llvm/test/Transforms/ThinLTOBitcodeWriter/split-vfunc-internal.ll

index 1644c65..37329b4 100644 (file)
@@ -55,7 +55,6 @@ void promoteInternals(Module &ExportM, Module &ImportM, StringRef ModuleId,
       }
     }
 
-    std::string OldName = Name.str();
     std::string NewName = (Name + ModuleId).str();
 
     if (const auto *C = ExportGV.getComdat())
@@ -70,13 +69,6 @@ void promoteInternals(Module &ExportM, Module &ImportM, StringRef ModuleId,
       ImportGV->setName(NewName);
       ImportGV->setVisibility(GlobalValue::HiddenVisibility);
     }
-
-    if (Function *F = dyn_cast<Function>(&ExportGV)) {
-      // Create a local alias with the original name to avoid breaking
-      // references from inline assembly.
-      std::string Alias = ".set " + OldName + "," + NewName + "\n";
-      ExportM.appendModuleInlineAsm(Alias);
-    }
   }
 
   if (!RenamedComdats.empty())
index 6501a01..42c15f1 100644 (file)
 ; RUN:   -r=%t1.o,_ZN1D1mEi, \
 ; RUN:   -r=%t1.o,test2, \
 ; RUN:   -r=%t2.o,_ZN1A1nEi,p \
-; RUN:   -r=%t2.o,_ZN1A1nEi, \
 ; RUN:   -r=%t2.o,_ZN1B1fEi,p \
 ; RUN:   -r=%t2.o,_ZN1C1fEi,p \
 ; RUN:   -r=%t2.o,_ZN1D1mEi,p \
 ; RUN:   -r=%t2.o,_ZN1E1mEi,p \
-; RUN:   -r=%t2.o,_ZN1E1mEi, \
 ; RUN:   -r=%t2.o,_ZTV1B, \
 ; RUN:   -r=%t2.o,_ZTV1C, \
 ; RUN:   -r=%t2.o,_ZTV1D, \
 ; RUN:   -r=%t1.o,_ZN1D1mEi, \
 ; RUN:   -r=%t1.o,test2, \
 ; RUN:   -r=%t2.o,_ZN1A1nEi,p \
-; RUN:   -r=%t2.o,_ZN1A1nEi, \
 ; RUN:   -r=%t2.o,_ZN1B1fEi,p \
 ; RUN:   -r=%t2.o,_ZN1C1fEi,p \
 ; RUN:   -r=%t2.o,_ZN1D1mEi,p \
 ; RUN:   -r=%t2.o,_ZN1E1mEi,p \
-; RUN:   -r=%t2.o,_ZN1E1mEi, \
 ; RUN:   -r=%t2.o,_ZTV1B, \
 ; RUN:   -r=%t2.o,_ZTV1C, \
 ; RUN:   -r=%t2.o,_ZTV1D, \
diff --git a/llvm/test/Transforms/ThinLTOBitcodeWriter/cfi-icall-static-inline-asm.ll b/llvm/test/Transforms/ThinLTOBitcodeWriter/cfi-icall-static-inline-asm.ll
deleted file mode 100644 (file)
index bb35891..0000000
+++ /dev/null
@@ -1,21 +0,0 @@
-; RUN: opt -thinlto-bc -thinlto-split-lto-unit -o - %s | llvm-modextract -b -n 0 -o - | llvm-dis | FileCheck %s
-
-target triple = "x86_64-unknown-linux-gnu"
-
-; CHECK: module asm ".set a,a.[[HASH:[0-9a-f]+]]"
-
-define void @b() {
-  %f = alloca void ()*, align 8
-  ; CHECK: store{{.*}} @a.[[HASH]],{{.*}} %f
-  store void ()* @a, void ()** %f, align 8
-  ; CHECK: %1 = call void ()* asm sideeffect "leaq a(%rip)
-  %1 = call void ()* asm sideeffect "leaq a(%rip), $0\0A\09", "=r,~{dirflag},~{fpsr},~{flags}"()
-  ret void
-}
-
-; CHECK: define{{.*}} @a.[[HASH]](){{.*}} !type
-define internal void @a() !type !0 {
-  ret void
-}
-
-!0 = !{i64 0, !"typeid1"}
index ccb8c4c..98cc80e 100644 (file)
@@ -7,8 +7,6 @@
 ; RUN: llvm-bcanalyzer -dump %t0 | FileCheck --check-prefix=BCA0 %s
 ; RUN: llvm-bcanalyzer -dump %t1 | FileCheck --check-prefix=BCA1 %s
 
-target triple = "x86_64-unknown-linux-gnu"
-
 ; ERROR: llvm-modextract: error: module index out of range; bitcode file contains 2 module(s)
 
 ; BCA0: <GLOBALVAL_SUMMARY_BLOCK
index 3774f16..d17cbef 100644 (file)
@@ -2,8 +2,6 @@
 ; RUN: llvm-modextract -b -n 0 -o - %t | llvm-dis | FileCheck --check-prefix=M0 %s
 ; RUN: llvm-modextract -b -n 1 -o - %t | llvm-dis | FileCheck --check-prefix=M1 %s
 
-target triple = "x86_64-unknown-linux-gnu"
-
 define [1 x i8*]* @source() {
   ret [1 x i8*]* @g
 }