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

Anshil Gandhi via llvm-commits llvm-commits at lists.llvm.org
Sun Aug 25 11:48:01 PDT 2024


https://github.com/gandhi56 created https://github.com/llvm/llvm-project/pull/106000

This reverts commit 33f3ebc86e7d3afcb65c551feba5bbc2421b42ed.


>From 4ed32a32aa3b5ee74af7ad585d6673149cda9fd9 Mon Sep 17 00:00:00 2001
From: Anshil Gandhi <gandhi21299 at gmail.com>
Date: Sun, 25 Aug 2024 14:45:00 -0400
Subject: [PATCH] Revert "[AMDGPU][LTO] Assume closed world after linking
 (#105845)"

This reverts commit 33f3ebc86e7d3afcb65c551feba5bbc2421b42ed.
---
 llvm/lib/Target/AMDGPU/AMDGPUAttributor.cpp    |  4 ----
 llvm/lib/Target/AMDGPU/AMDGPUTargetMachine.cpp |  8 ++------
 llvm/test/LTO/AMDGPU/gpu-rdc-amdgpu-attrs.ll   | 10 ----------
 3 files changed, 2 insertions(+), 20 deletions(-)
 delete mode 100644 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 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
-}



More information about the llvm-commits mailing list