Skip to content

Commit 001cf04

Browse files
committed
Revert "[AMDGPU][LTO] Assume closed world after linking (#105845)"
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. We can re-enable it once we can handle it correctly.
1 parent e4f3b56 commit 001cf04

File tree

3 files changed

+2
-23
lines changed

3 files changed

+2
-23
lines changed

llvm/lib/Target/AMDGPU/AMDGPUAttributor.cpp

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1065,10 +1065,6 @@ static bool runImpl(Module &M, AnalysisGetter &AG, TargetMachine &TM,
10651065

10661066
Attributor A(Functions, InfoCache, AC);
10671067

1068-
LLVM_DEBUG(dbgs() << "Module " << M.getName() << " is "
1069-
<< (AC.IsClosedWorldModule ? "" : "not ")
1070-
<< "assumed to be a closed world.\n");
1071-
10721068
for (Function &F : M) {
10731069
if (F.isIntrinsic())
10741070
continue;

llvm/lib/Target/AMDGPU/AMDGPUTargetMachine.cpp

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -771,12 +771,8 @@ void AMDGPUTargetMachine::registerPassBuilderCallbacks(PassBuilder &PB) {
771771
PM.addPass(AMDGPUSwLowerLDSPass(*this));
772772
if (EnableLowerModuleLDS)
773773
PM.addPass(AMDGPULowerModuleLDSPass(*this));
774-
775-
if (EnableAMDGPUAttributor && Level != OptimizationLevel::O0) {
776-
AMDGPUAttributorOptions Opts;
777-
Opts.IsClosedWorld = true;
778-
PM.addPass(AMDGPUAttributorPass(*this, Opts));
779-
}
774+
if (EnableAMDGPUAttributor && Level != OptimizationLevel::O0)
775+
PM.addPass(AMDGPUAttributorPass(*this));
780776
});
781777

782778
PB.registerRegClassFilterParsingCallback(

llvm/test/LTO/AMDGPU/gpu-rdc-amdgpu-attrs.ll

Lines changed: 0 additions & 13 deletions
This file was deleted.

0 commit comments

Comments
 (0)