[llvm] 84ed3c2 - Revert "[AMDGPU][LTO] Assume closed world after linking (#105845)" (#106889)
via llvm-commits
llvm-commits at lists.llvm.org
Sun Sep 1 06:32:12 PDT 2024
Author: Shilei Tian
Date: 2024-09-01T09:32:08-04:00
New Revision: 84ed3c29e8583bdd704d0e2f7e7c3d1162c6181c
URL: https://github.com/llvm/llvm-project/commit/84ed3c29e8583bdd704d0e2f7e7c3d1162c6181c
DIFF: https://github.com/llvm/llvm-project/commit/84ed3c29e8583bdd704d0e2f7e7c3d1162c6181c.diff
LOG: Revert "[AMDGPU][LTO] Assume closed world after linking (#105845)" (#106889)
We can't assume closed world even in full LTO post-link stage. It is
only true
if we are building a "GPU executable". However, AMDGPU does support
"dyamic
library". I'm not aware of any approach to tell if it is relocatable
link when
we create the pass. For now let's revert the patch as it is currently
breaking things.
We can re-enable it once we can handle it correctly.
Added:
Modified:
llvm/lib/Target/AMDGPU/AMDGPUAttributor.cpp
llvm/lib/Target/AMDGPU/AMDGPUTargetMachine.cpp
Removed:
llvm/test/LTO/AMDGPU/gpu-rdc-amdgpu-attrs.ll
################################################################################
diff --git a/llvm/lib/Target/AMDGPU/AMDGPUAttributor.cpp b/llvm/lib/Target/AMDGPU/AMDGPUAttributor.cpp
index 0d7b4caa8156ed..72049f0aa6b86e 100644
--- a/llvm/lib/Target/AMDGPU/AMDGPUAttributor.cpp
+++ b/llvm/lib/Target/AMDGPU/AMDGPUAttributor.cpp
@@ -1065,10 +1065,6 @@ static bool runImpl(Module &M, AnalysisGetter &AG, TargetMachine &TM,
Attributor A(Functions, InfoCache, AC);
- LLVM_DEBUG(dbgs() << "Module " << M.getName() << " is "
- << (AC.IsClosedWorldModule ? "" : "not ")
- << "assumed to be a closed world.\n");
-
for (Function &F : M) {
if (F.isIntrinsic())
continue;
diff --git a/llvm/lib/Target/AMDGPU/AMDGPUTargetMachine.cpp b/llvm/lib/Target/AMDGPU/AMDGPUTargetMachine.cpp
index a769bc9e486573..7df39f35478077 100644
--- a/llvm/lib/Target/AMDGPU/AMDGPUTargetMachine.cpp
+++ b/llvm/lib/Target/AMDGPU/AMDGPUTargetMachine.cpp
@@ -771,12 +771,8 @@ void AMDGPUTargetMachine::registerPassBuilderCallbacks(PassBuilder &PB) {
PM.addPass(AMDGPUSwLowerLDSPass(*this));
if (EnableLowerModuleLDS)
PM.addPass(AMDGPULowerModuleLDSPass(*this));
-
- if (EnableAMDGPUAttributor && Level != OptimizationLevel::O0) {
- AMDGPUAttributorOptions Opts;
- Opts.IsClosedWorld = true;
- PM.addPass(AMDGPUAttributorPass(*this, Opts));
- }
+ if (EnableAMDGPUAttributor && Level != OptimizationLevel::O0)
+ PM.addPass(AMDGPUAttributorPass(*this));
});
PB.registerRegClassFilterParsingCallback(
diff --git a/llvm/test/LTO/AMDGPU/gpu-rdc-amdgpu-attrs.ll b/llvm/test/LTO/AMDGPU/gpu-rdc-amdgpu-attrs.ll
deleted file mode 100644
index 8228f21b56b132..00000000000000
--- a/llvm/test/LTO/AMDGPU/gpu-rdc-amdgpu-attrs.ll
+++ /dev/null
@@ -1,13 +0,0 @@
-; RUN: opt -O3 -debug-only=amdgpu-attributor -S -o - %s 2>&1 | FileCheck %s --check-prefix=PRE-LINK
-; RUN: opt -passes="lto<O3>" -debug-only=amdgpu-attributor -S -o - %s 2>&1 | FileCheck %s --check-prefix=POST-LINK
-
-; REQUIRES: amdgpu-registered-target
-; REQUIRES: asserts
-
-target triple = "amdgcn-amd-amdhsa"
-
-; PRE-LINK: Module {{.*}} is not assumed to be a closed world.
-; POST-LINK: Module {{.*}} is assumed to be a closed world.
-define hidden noundef i32 @_Z3foov() {
- ret i32 1
-}
More information about the llvm-commits
mailing list