From e5dd58e3a6deacfaaf67fde790f86b8410b18c51 Mon Sep 17 00:00:00 2001 From: Jonas Hahnfeld Date: Fri, 3 Feb 2023 10:04:38 +0100 Subject: [PATCH] Revert "[ORC] Drop Comdat when discarding IR symbol" 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 | 4 ---- llvm/test/ExecutionEngine/Orc/Inputs/weak-comdat-def.ll | 6 ------ llvm/test/ExecutionEngine/Orc/weak-comdat.ll | 14 -------------- 3 files changed, 24 deletions(-) delete mode 100644 llvm/test/ExecutionEngine/Orc/Inputs/weak-comdat-def.ll delete mode 100644 llvm/test/ExecutionEngine/Orc/weak-comdat.ll diff --git a/llvm/lib/ExecutionEngine/Orc/Layer.cpp b/llvm/lib/ExecutionEngine/Orc/Layer.cpp index 3368d32..95380d91 100644 --- a/llvm/lib/ExecutionEngine/Orc/Layer.cpp +++ b/llvm/lib/ExecutionEngine/Orc/Layer.cpp @@ -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(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 index 9c308a3..0000000 --- a/llvm/test/ExecutionEngine/Orc/Inputs/weak-comdat-def.ll +++ /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 index d11e462..0000000 --- a/llvm/test/ExecutionEngine/Orc/weak-comdat.ll +++ /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 -} -- 2.7.4