Revert "[ORC] Drop Comdat when discarding IR symbol"
authorJonas Hahnfeld <jonas.hahnfeld@cern.ch>
Fri, 3 Feb 2023 09:04:38 +0000 (10:04 +0100)
committerJonas Hahnfeld <jonas.hahnfeld@cern.ch>
Fri, 3 Feb 2023 09:04:38 +0000 (10:04 +0100)
Failure on Windows:
LLVM ERROR: Associative COMDAT symbol 'c' does not exist.

This reverts commit 76b3f0b4d5a0b8c54147c4c73a30892bbca76467 while
I investigate the problem and a solution that still triggers the
original problem.

llvm/lib/ExecutionEngine/Orc/Layer.cpp
llvm/test/ExecutionEngine/Orc/Inputs/weak-comdat-def.ll [deleted file]
llvm/test/ExecutionEngine/Orc/weak-comdat.ll [deleted file]

index 3368d32..95380d9 100644 (file)
@@ -125,10 +125,6 @@ void IRMaterializationUnit::discard(const JITDylib &JD,
   assert(!I->second->isDeclaration() &&
          "Discard should only apply to definitions");
   I->second->setLinkage(GlobalValue::AvailableExternallyLinkage);
-  // According to the IR verifier, "Declaration[s] may not be in a Comdat!"
-  // Remove it, if this is a GlobalObject.
-  if (auto *GO = dyn_cast<GlobalObject>(I->second))
-    GO->setComdat(nullptr);
   SymbolToDefinition.erase(I);
 }
 
diff --git a/llvm/test/ExecutionEngine/Orc/Inputs/weak-comdat-def.ll b/llvm/test/ExecutionEngine/Orc/Inputs/weak-comdat-def.ll
deleted file mode 100644 (file)
index 9c308a3..0000000
+++ /dev/null
@@ -1,6 +0,0 @@
-$c = comdat any
-
-define i32 @f() comdat($c) {
-entry:
-  ret i32 0
-}
diff --git a/llvm/test/ExecutionEngine/Orc/weak-comdat.ll b/llvm/test/ExecutionEngine/Orc/weak-comdat.ll
deleted file mode 100644 (file)
index d11e462..0000000
+++ /dev/null
@@ -1,14 +0,0 @@
-; RUN: lli -extra-module %p/Inputs/weak-comdat-def.ll %s
-
-$c = comdat any
-
-define weak i32 @f() comdat($c) {
-entry:
-  ret i32 0
-}
-
-define i32 @main() {
-entry:
-  %0 = call i32 @f()
-  ret i32 %0
-}