Skip to content

Commit 84ed3c2

Browse files
authored
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.
1 parent 7c4cffd commit 84ed3c2

File tree

3 files changed

+2
-23
lines changed

3 files changed

+2
-23
lines changed

llvm/lib/Target/AMDGPU/AMDGPUAttributor.cpp

-4
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

+2-6
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

-13
This file was deleted.

0 commit comments

Comments
 (0)