Skip to content

Revert "[AMDGPU][LTO] Assume closed world after linking (#105845)" #106000

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 25, 2024

Conversation

gandhi56
Copy link
Contributor

This reverts commit 33f3ebc.

@llvmbot llvmbot added backend:AMDGPU LTO Link time optimization (regular/full LTO or ThinLTO) labels Aug 25, 2024
@llvmbot
Copy link
Member

llvmbot commented Aug 25, 2024

@llvm/pr-subscribers-lto

@llvm/pr-subscribers-backend-amdgpu

Author: Anshil Gandhi (gandhi56)

Changes

This reverts commit 33f3ebc.


Full diff: https://github.com/llvm/llvm-project/pull/106000.diff

3 Files Affected:

  • (modified) llvm/lib/Target/AMDGPU/AMDGPUAttributor.cpp (-4)
  • (modified) llvm/lib/Target/AMDGPU/AMDGPUTargetMachine.cpp (+2-6)
  • (removed) llvm/test/LTO/AMDGPU/gpu-rdc-amdgpu-attrs.ll (-10)
diff --git a/llvm/lib/Target/AMDGPU/AMDGPUAttributor.cpp b/llvm/lib/Target/AMDGPU/AMDGPUAttributor.cpp
index 81932cc2c3c3bc..d65e0ae92308e6 100644
--- a/llvm/lib/Target/AMDGPU/AMDGPUAttributor.cpp
+++ b/llvm/lib/Target/AMDGPU/AMDGPUAttributor.cpp
@@ -1066,10 +1066,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 307774ea3da9eb..7ac7b3315bb972 100644
--- a/llvm/lib/Target/AMDGPU/AMDGPUTargetMachine.cpp
+++ b/llvm/lib/Target/AMDGPU/AMDGPUTargetMachine.cpp
@@ -760,12 +760,8 @@ void AMDGPUTargetMachine::registerPassBuilderCallbacks(PassBuilder &PB) {
         // module is partitioned for codegen.
         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 6966c702e741cc..00000000000000
--- a/llvm/test/LTO/AMDGPU/gpu-rdc-amdgpu-attrs.ll
+++ /dev/null
@@ -1,10 +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
-
-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
-}

@gandhi56 gandhi56 merged commit 4b6c064 into llvm:main Aug 25, 2024
8 of 11 checks passed
@gandhi56 gandhi56 deleted the gpu-rdc/revert-gpu-rdc-amdgpu-attrs branch August 25, 2024 18:56
gandhi56 added a commit to gandhi56/llvm-project that referenced this pull request Aug 25, 2024
…#105845)" (llvm#106000)"

This reverts commit 4b6c064.

Add a requirement for an amdgpu target in the test.
gandhi56 added a commit that referenced this pull request Aug 25, 2024
)" (#106000)" (#106001)

This reverts commit 4b6c064.

Add a requirement for an amdgpu target in the test.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backend:AMDGPU LTO Link time optimization (regular/full LTO or ThinLTO)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants