[llvm] 9393894 - Revert "ThinLTO: Fix inline assembly references to static functions with CFI"

Zequan Wu via llvm-commits llvm-commits at lists.llvm.org
Wed Jun 23 19:25:07 PDT 2021


Author: Zequan Wu
Date: 2021-06-23T19:24:56-07:00
New Revision: 9393894331e9eba97bdafe92454af74550baf6d3

URL: https://github.com/llvm/llvm-project/commit/9393894331e9eba97bdafe92454af74550baf6d3
DIFF: https://github.com/llvm/llvm-project/commit/9393894331e9eba97bdafe92454af74550baf6d3.diff

LOG: Revert "ThinLTO: Fix inline assembly references to static functions with CFI"

This casues compiler crash: Assertion `materialized_use_empty() && "Uses remain when a value is destroyed!"'

This reverts commit e3d24b45b8f808ec66213e134c4ceda5202fbe31.

Added: 
    

Modified: 
    llvm/lib/Transforms/IPO/ThinLTOBitcodeWriter.cpp

Removed: 
    llvm/test/Transforms/ThinLTOBitcodeWriter/cfi-icall-static-inline-asm.ll


################################################################################
diff  --git a/llvm/lib/Transforms/IPO/ThinLTOBitcodeWriter.cpp b/llvm/lib/Transforms/IPO/ThinLTOBitcodeWriter.cpp
index 009b6e34b783f..37329b489555e 100644
--- a/llvm/lib/Transforms/IPO/ThinLTOBitcodeWriter.cpp
+++ b/llvm/lib/Transforms/IPO/ThinLTOBitcodeWriter.cpp
@@ -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,15 +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.
-      GlobalAlias *A = GlobalAlias::create(
-          F->getValueType(), F->getAddressSpace(), GlobalValue::InternalLinkage,
-          OldName, F, &ExportM);
-      appendToCompilerUsed(ExportM, A);
-    }
   }
 
   if (!RenamedComdats.empty())

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
index 70f5322faa52a..0000000000000
--- a/llvm/test/Transforms/ThinLTOBitcodeWriter/cfi-icall-static-inline-asm.ll
+++ /dev/null
@@ -1,19 +0,0 @@
-; RUN: opt -thinlto-bc -thinlto-split-lto-unit -o - %s | llvm-modextract -b -n 0 -o - | llvm-dis | FileCheck %s
-
-; CHECK: @a = internal alias {{.*}}@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"}


        


More information about the llvm-commits mailing list