Skip to content

Commit d34a10a

Browse files
authored
AMDGPU: Port AMDGPUAttributor to new pass manager (#71349)
1 parent c78aeab commit d34a10a

25 files changed

+112
-79
lines changed

llvm/lib/Target/AMDGPU/AMDGPU.h

+12-2
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
namespace llvm {
1818

1919
class AMDGPUTargetMachine;
20+
class GCNTargetMachine;
2021
class TargetMachine;
2122

2223
// GlobalISel passes
@@ -86,8 +87,8 @@ extern char &AMDGPUMachineCFGStructurizerID;
8687
void initializeAMDGPUAlwaysInlinePass(PassRegistry&);
8788

8889
Pass *createAMDGPUAnnotateKernelFeaturesPass();
89-
Pass *createAMDGPUAttributorPass();
90-
void initializeAMDGPUAttributorPass(PassRegistry &);
90+
Pass *createAMDGPUAttributorLegacyPass();
91+
void initializeAMDGPUAttributorLegacyPass(PassRegistry &);
9192
void initializeAMDGPUAnnotateKernelFeaturesPass(PassRegistry &);
9293
extern char &AMDGPUAnnotateKernelFeaturesID;
9394

@@ -262,6 +263,15 @@ class AMDGPULowerKernelArgumentsPass
262263
PreservedAnalyses run(Function &, FunctionAnalysisManager &);
263264
};
264265

266+
class AMDGPUAttributorPass : public PassInfoMixin<AMDGPUAttributorPass> {
267+
private:
268+
TargetMachine &TM;
269+
270+
public:
271+
AMDGPUAttributorPass(TargetMachine &TM) : TM(TM){};
272+
PreservedAnalyses run(Module &M, ModuleAnalysisManager &AM);
273+
};
274+
265275
FunctionPass *createAMDGPUAnnotateUniformValues();
266276

267277
ModulePass *createAMDGPUPrintfRuntimeBinding();

llvm/lib/Target/AMDGPU/AMDGPUAttributor.cpp

+67-49
Original file line numberDiff line numberDiff line change
@@ -933,9 +933,53 @@ static void addPreloadKernArgHint(Function &F, TargetMachine &TM) {
933933
}
934934
}
935935

936-
class AMDGPUAttributor : public ModulePass {
936+
static bool runImpl(Module &M, AnalysisGetter &AG, TargetMachine &TM) {
937+
SetVector<Function *> Functions;
938+
for (Function &F : M) {
939+
if (!F.isIntrinsic())
940+
Functions.insert(&F);
941+
}
942+
943+
CallGraphUpdater CGUpdater;
944+
BumpPtrAllocator Allocator;
945+
AMDGPUInformationCache InfoCache(M, AG, Allocator, nullptr, TM);
946+
DenseSet<const char *> Allowed(
947+
{&AAAMDAttributes::ID, &AAUniformWorkGroupSize::ID,
948+
&AAPotentialValues::ID, &AAAMDFlatWorkGroupSize::ID,
949+
&AAAMDWavesPerEU::ID, &AACallEdges::ID, &AAPointerInfo::ID,
950+
&AAPotentialConstantValues::ID, &AAUnderlyingObjects::ID});
951+
952+
AttributorConfig AC(CGUpdater);
953+
AC.Allowed = &Allowed;
954+
AC.IsModulePass = true;
955+
AC.DefaultInitializeLiveInternals = false;
956+
AC.IPOAmendableCB = [](const Function &F) {
957+
return F.getCallingConv() == CallingConv::AMDGPU_KERNEL;
958+
};
959+
960+
Attributor A(Functions, InfoCache, AC);
961+
962+
for (Function &F : M) {
963+
if (!F.isIntrinsic()) {
964+
A.getOrCreateAAFor<AAAMDAttributes>(IRPosition::function(F));
965+
A.getOrCreateAAFor<AAUniformWorkGroupSize>(IRPosition::function(F));
966+
CallingConv::ID CC = F.getCallingConv();
967+
if (!AMDGPU::isEntryFunctionCC(CC)) {
968+
A.getOrCreateAAFor<AAAMDFlatWorkGroupSize>(IRPosition::function(F));
969+
A.getOrCreateAAFor<AAAMDWavesPerEU>(IRPosition::function(F));
970+
} else if (CC == CallingConv::AMDGPU_KERNEL) {
971+
addPreloadKernArgHint(F, TM);
972+
}
973+
}
974+
}
975+
976+
ChangeStatus Change = A.run();
977+
return Change == ChangeStatus::CHANGED;
978+
}
979+
980+
class AMDGPUAttributorLegacy : public ModulePass {
937981
public:
938-
AMDGPUAttributor() : ModulePass(ID) {}
982+
AMDGPUAttributorLegacy() : ModulePass(ID) {}
939983

940984
/// doInitialization - Virtual method overridden by subclasses to do
941985
/// any necessary initialization before any pass is run.
@@ -949,48 +993,8 @@ class AMDGPUAttributor : public ModulePass {
949993
}
950994

951995
bool runOnModule(Module &M) override {
952-
SetVector<Function *> Functions;
953996
AnalysisGetter AG(this);
954-
for (Function &F : M) {
955-
if (!F.isIntrinsic())
956-
Functions.insert(&F);
957-
}
958-
959-
CallGraphUpdater CGUpdater;
960-
BumpPtrAllocator Allocator;
961-
AMDGPUInformationCache InfoCache(M, AG, Allocator, nullptr, *TM);
962-
DenseSet<const char *> Allowed(
963-
{&AAAMDAttributes::ID, &AAUniformWorkGroupSize::ID,
964-
&AAPotentialValues::ID, &AAAMDFlatWorkGroupSize::ID,
965-
&AAAMDWavesPerEU::ID, &AACallEdges::ID, &AAPointerInfo::ID,
966-
&AAPotentialConstantValues::ID, &AAUnderlyingObjects::ID});
967-
968-
AttributorConfig AC(CGUpdater);
969-
AC.Allowed = &Allowed;
970-
AC.IsModulePass = true;
971-
AC.DefaultInitializeLiveInternals = false;
972-
AC.IPOAmendableCB = [](const Function &F) {
973-
return F.getCallingConv() == CallingConv::AMDGPU_KERNEL;
974-
};
975-
976-
Attributor A(Functions, InfoCache, AC);
977-
978-
for (Function &F : M) {
979-
if (!F.isIntrinsic()) {
980-
A.getOrCreateAAFor<AAAMDAttributes>(IRPosition::function(F));
981-
A.getOrCreateAAFor<AAUniformWorkGroupSize>(IRPosition::function(F));
982-
CallingConv::ID CC = F.getCallingConv();
983-
if (!AMDGPU::isEntryFunctionCC(CC)) {
984-
A.getOrCreateAAFor<AAAMDFlatWorkGroupSize>(IRPosition::function(F));
985-
A.getOrCreateAAFor<AAAMDWavesPerEU>(IRPosition::function(F));
986-
} else if (CC == CallingConv::AMDGPU_KERNEL) {
987-
addPreloadKernArgHint(F, *TM);
988-
}
989-
}
990-
}
991-
992-
ChangeStatus Change = A.run();
993-
return Change == ChangeStatus::CHANGED;
997+
return runImpl(M, AG, *TM);
994998
}
995999

9961000
void getAnalysisUsage(AnalysisUsage &AU) const override {
@@ -1003,11 +1007,25 @@ class AMDGPUAttributor : public ModulePass {
10031007
};
10041008
} // namespace
10051009

1006-
char AMDGPUAttributor::ID = 0;
1010+
PreservedAnalyses llvm::AMDGPUAttributorPass::run(Module &M,
1011+
ModuleAnalysisManager &AM) {
10071012

1008-
Pass *llvm::createAMDGPUAttributorPass() { return new AMDGPUAttributor(); }
1009-
INITIALIZE_PASS_BEGIN(AMDGPUAttributor, DEBUG_TYPE, "AMDGPU Attributor", false,
1010-
false)
1013+
FunctionAnalysisManager &FAM =
1014+
AM.getResult<FunctionAnalysisManagerModuleProxy>(M).getManager();
1015+
AnalysisGetter AG(FAM);
1016+
1017+
// TODO: Probably preserves CFG
1018+
return runImpl(M, AG, TM) ? PreservedAnalyses::none()
1019+
: PreservedAnalyses::all();
1020+
}
1021+
1022+
char AMDGPUAttributorLegacy::ID = 0;
1023+
1024+
Pass *llvm::createAMDGPUAttributorLegacyPass() {
1025+
return new AMDGPUAttributorLegacy();
1026+
}
1027+
INITIALIZE_PASS_BEGIN(AMDGPUAttributorLegacy, DEBUG_TYPE, "AMDGPU Attributor",
1028+
false, false)
10111029
INITIALIZE_PASS_DEPENDENCY(CycleInfoWrapperPass);
1012-
INITIALIZE_PASS_END(AMDGPUAttributor, DEBUG_TYPE, "AMDGPU Attributor", false,
1013-
false)
1030+
INITIALIZE_PASS_END(AMDGPUAttributorLegacy, DEBUG_TYPE, "AMDGPU Attributor",
1031+
false, false)

llvm/lib/Target/AMDGPU/AMDGPUTargetMachine.cpp

+6-2
Original file line numberDiff line numberDiff line change
@@ -381,7 +381,7 @@ extern "C" LLVM_EXTERNAL_VISIBILITY void LLVMInitializeAMDGPUTarget() {
381381
initializeSILoadStoreOptimizerPass(*PR);
382382
initializeAMDGPUCtorDtorLoweringLegacyPass(*PR);
383383
initializeAMDGPUAlwaysInlinePass(*PR);
384-
initializeAMDGPUAttributorPass(*PR);
384+
initializeAMDGPUAttributorLegacyPass(*PR);
385385
initializeAMDGPUAnnotateKernelFeaturesPass(*PR);
386386
initializeAMDGPUAnnotateUniformValuesPass(*PR);
387387
initializeAMDGPUArgumentUsageInfoPass(*PR);
@@ -610,6 +610,10 @@ void AMDGPUTargetMachine::registerPassBuilderCallbacks(PassBuilder &PB) {
610610
PB.registerPipelineParsingCallback(
611611
[this](StringRef PassName, ModulePassManager &PM,
612612
ArrayRef<PassBuilder::PipelineElement>) {
613+
if (PassName == "amdgpu-attributor") {
614+
PM.addPass(AMDGPUAttributorPass(*this));
615+
return true;
616+
}
613617
if (PassName == "amdgpu-unify-metadata") {
614618
PM.addPass(AMDGPUUnifyMetadataPass());
615619
return true;
@@ -1021,7 +1025,7 @@ void AMDGPUPassConfig::addIRPasses() {
10211025
// AMDGPUAttributor infers lack of llvm.amdgcn.lds.kernel.id calls, so run
10221026
// after their introduction
10231027
if (TM.getOptLevel() > CodeGenOptLevel::None)
1024-
addPass(createAMDGPUAttributorPass());
1028+
addPass(createAMDGPUAttributorLegacyPass());
10251029

10261030
if (TM.getOptLevel() > CodeGenOptLevel::None)
10271031
addPass(createInferAddressSpacesPass());

llvm/test/CodeGen/AMDGPU/addrspacecast-constantexpr.ll

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --function-signature --check-globals
22
; RUN: opt -mtriple=amdgcn-unknown-amdhsa -S -amdgpu-annotate-kernel-features < %s | FileCheck -check-prefixes=HSA,AKF_HSA %s
3-
; RUN: opt -mtriple=amdgcn-unknown-amdhsa -S -amdgpu-attributor < %s | FileCheck -check-prefixes=HSA,ATTRIBUTOR_HSA %s
3+
; RUN: opt -mtriple=amdgcn-unknown-amdhsa -S -passes=amdgpu-attributor < %s | FileCheck -check-prefixes=HSA,ATTRIBUTOR_HSA %s
44

55
declare void @llvm.memcpy.p1.p4.i32(ptr addrspace(1) nocapture, ptr addrspace(4) nocapture, i32, i1) #0
66

llvm/test/CodeGen/AMDGPU/annotate-existing-abi-attributes.ll

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --function-signature --check-globals
2-
; RUN: opt -mtriple=amdgcn-unknown-amdhsa -S -amdgpu-attributor %s | FileCheck %s
2+
; RUN: opt -mtriple=amdgcn-unknown-amdhsa -S -passes=amdgpu-attributor %s | FileCheck %s
33

44
; Check handling for pre-existing attributes on function declarations
55

llvm/test/CodeGen/AMDGPU/annotate-kernel-features-hsa-call.ll

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --function-signature --check-globals
22
; RUN: opt -mtriple=amdgcn-unknown-amdhsa -S -amdgpu-annotate-kernel-features < %s | FileCheck -check-prefixes=AKF_HSA %s
3-
; RUN: opt -mtriple=amdgcn-unknown-amdhsa -S -amdgpu-attributor < %s | FileCheck -check-prefixes=ATTRIBUTOR_HSA %s
3+
; RUN: opt -mtriple=amdgcn-unknown-amdhsa -S -passes=amdgpu-attributor < %s | FileCheck -check-prefixes=ATTRIBUTOR_HSA %s
44

55
; TODO: The test contains UB which is refined by the Attributor and should be removed.
66

llvm/test/CodeGen/AMDGPU/annotate-kernel-features-hsa.ll

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --function-signature --check-globals
22
; RUN: opt -mtriple=amdgcn-unknown-amdhsa -S -amdgpu-annotate-kernel-features < %s | FileCheck -check-prefixes=HSA,AKF_HSA %s
3-
; RUN: opt -mtriple=amdgcn-unknown-amdhsa -S -amdgpu-attributor < %s | FileCheck -check-prefixes=HSA,ATTRIBUTOR_HSA %s
3+
; RUN: opt -mtriple=amdgcn-unknown-amdhsa -S -passes=amdgpu-attributor < %s | FileCheck -check-prefixes=HSA,ATTRIBUTOR_HSA %s
44

55
target datalayout = "e-p:64:64-p1:64:64-p2:32:32-p3:32:32-p4:64:64-p5:32:32-p6:32:32-p7:160:256:256:32-p8:128:128-i64:64-v16:16-v24:32-v32:32-v48:64-v96:128-v192:256-v256:256-v512:512-v1024:1024-v2048:2048-n32:64-S32-A5"
66

llvm/test/CodeGen/AMDGPU/annotate-kernel-features.ll

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --function-signature --check-globals
22
; RUN: opt -S -mtriple=amdgcn-unknown-unknown -amdgpu-annotate-kernel-features < %s | FileCheck -check-prefixes=CHECK,AKF_CHECK %s
3-
; RUN: opt -S -mtriple=amdgcn-unknown-unknown -amdgpu-attributor < %s | FileCheck -check-prefixes=CHECK,ATTRIBUTOR_CHECK %s
3+
; RUN: opt -S -mtriple=amdgcn-unknown-unknown -passes=amdgpu-attributor < %s | FileCheck -check-prefixes=CHECK,ATTRIBUTOR_CHECK %s
44

55
declare i32 @llvm.r600.read.tgid.x() #0
66
declare i32 @llvm.r600.read.tgid.y() #0

llvm/test/CodeGen/AMDGPU/attributor-loop-issue-58639.ll

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --function-signature --check-globals
2-
; RUN: opt -S -mtriple=amdgcn-amd-amdhsa -amdgpu-attributor %s | FileCheck %s
2+
; RUN: opt -S -mtriple=amdgcn-amd-amdhsa -passes=amdgpu-attributor %s | FileCheck %s
33

44
%0 = type { ptr, ptr }
55

llvm/test/CodeGen/AMDGPU/direct-indirect-call.ll

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --function-signature --check-globals
2-
; RUN: opt -S -mtriple=amdgcn-amd-amdhsa -amdgpu-attributor < %s | FileCheck %s
2+
; RUN: opt -S -mtriple=amdgcn-amd-amdhsa -passes=amdgpu-attributor < %s | FileCheck %s
33

44
define internal void @indirect() {
55
; CHECK-LABEL: define {{[^@]+}}@indirect

llvm/test/CodeGen/AMDGPU/duplicate-attribute-indirect.ll

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --function-signature --check-globals
22
; RUN: opt -S -mtriple=amdgcn-amd-amdhsa -amdgpu-annotate-kernel-features %s | FileCheck -check-prefix=AKF_GCN %s
3-
; RUN: opt -S -mtriple=amdgcn-amd-amdhsa -amdgpu-attributor %s | FileCheck -check-prefix=ATTRIBUTOR_GCN %s
3+
; RUN: opt -S -mtriple=amdgcn-amd-amdhsa -passes=amdgpu-attributor %s | FileCheck -check-prefix=ATTRIBUTOR_GCN %s
44

55
define internal void @indirect() {
66
; AKF_GCN-LABEL: define {{[^@]+}}@indirect() {

llvm/test/CodeGen/AMDGPU/implicitarg-offset-attributes.ll

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --function-signature --check-attributes --check-globals
2-
; RUN: sed 's/CODE_OBJECT_VERSION/400/g' %s | opt -S -mtriple=amdgcn-unknown-unknown -amdgpu-attributor | FileCheck -check-prefixes=CHECK,V4 %s
3-
; RUN: sed 's/CODE_OBJECT_VERSION/500/g' %s | opt -S -mtriple=amdgcn-unknown-unknown -amdgpu-attributor | FileCheck -check-prefixes=CHECK,V5 %s
2+
; RUN: sed 's/CODE_OBJECT_VERSION/400/g' %s | opt -S -mtriple=amdgcn-unknown-unknown -passes=amdgpu-attributor | FileCheck -check-prefixes=CHECK,V4 %s
3+
; RUN: sed 's/CODE_OBJECT_VERSION/500/g' %s | opt -S -mtriple=amdgcn-unknown-unknown -passes=amdgpu-attributor | FileCheck -check-prefixes=CHECK,V5 %s
44

55
declare ptr addrspace(4) @llvm.amdgcn.implicitarg.ptr() #0
66

llvm/test/CodeGen/AMDGPU/pal-simple-indirect-call.ll

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --function-signature --check-globals
22
; Check that no attributes are added to graphics functions
33
; RUN: opt -S -mtriple=amdgcn-amd-amdpal -amdgpu-annotate-kernel-features %s | FileCheck -check-prefixes=AKF_GCN %s
4-
; RUN: opt -S -mtriple=amdgcn-amd-amdpal -amdgpu-attributor %s | FileCheck -check-prefixes=ATTRIBUTOR_GCN %s
4+
; RUN: opt -S -mtriple=amdgcn-amd-amdpal -passes=amdgpu-attributor %s | FileCheck -check-prefixes=ATTRIBUTOR_GCN %s
55

66
; Check that it doesn't crash
77
; RUN: llc -mtriple=amdgcn-amd-amdpal -mcpu=gfx900 < %s | FileCheck -check-prefixes=GFX9 %s

llvm/test/CodeGen/AMDGPU/preload-kernargs-inreg-hints.ll

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --function-signature
2-
; RUN: opt -mtriple=amdgcn-amd-amdhsa -mcpu=gfx90a -amdgpu-attributor -S < %s | FileCheck -check-prefix=NO-PRELOAD %s
3-
; RUN: opt -mtriple=amdgcn-amd-amdhsa -mcpu=gfx90a -amdgpu-kernarg-preload-count=1 -amdgpu-attributor -S < %s | FileCheck -check-prefix=PRELOAD-1 %s
4-
; RUN: opt -mtriple=amdgcn-amd-amdhsa -mcpu=gfx90a -amdgpu-kernarg-preload-count=3 -amdgpu-attributor -S < %s | FileCheck -check-prefix=PRELOAD-3 %s
5-
; RUN: opt -mtriple=amdgcn-amd-amdhsa -mcpu=gfx90a -amdgpu-kernarg-preload-count=16 -amdgpu-attributor -S < %s | FileCheck -check-prefix=PRELOAD-16 %s
6-
; RUN: opt -mtriple=amdgcn-amd-amdhsa -mcpu=gfx90a -amdgpu-kernarg-preload-count=20 -amdgpu-attributor -S < %s | FileCheck -check-prefix=PRELOAD-20 %s
2+
; RUN: opt -mtriple=amdgcn-amd-amdhsa -mcpu=gfx90a -passes=amdgpu-attributor -S < %s | FileCheck -check-prefix=NO-PRELOAD %s
3+
; RUN: opt -mtriple=amdgcn-amd-amdhsa -mcpu=gfx90a -amdgpu-kernarg-preload-count=1 -passes=amdgpu-attributor -S < %s | FileCheck -check-prefix=PRELOAD-1 %s
4+
; RUN: opt -mtriple=amdgcn-amd-amdhsa -mcpu=gfx90a -amdgpu-kernarg-preload-count=3 -passes=amdgpu-attributor -S < %s | FileCheck -check-prefix=PRELOAD-3 %s
5+
; RUN: opt -mtriple=amdgcn-amd-amdhsa -mcpu=gfx90a -amdgpu-kernarg-preload-count=16 -passes=amdgpu-attributor -S < %s | FileCheck -check-prefix=PRELOAD-16 %s
6+
; RUN: opt -mtriple=amdgcn-amd-amdhsa -mcpu=gfx90a -amdgpu-kernarg-preload-count=20 -passes=amdgpu-attributor -S < %s | FileCheck -check-prefix=PRELOAD-20 %s
77

88
define amdgpu_kernel void @test_preload_hint_kernel_1(ptr %0) #0 {
99
; NO-PRELOAD-LABEL: define {{[^@]+}}@test_preload_hint_kernel_1

llvm/test/CodeGen/AMDGPU/propagate-flat-work-group-size.ll

+1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --function-signature --check-globals
22
; RUN: opt -S -mtriple=amdgcn-amd-amdhsa -amdgpu-attributor %s | FileCheck %s
3+
; RUN: opt -S -mtriple=amdgcn-amd-amdhsa -passes=amdgpu-attributor %s | FileCheck %s
34

45
; Check propagation of amdgpu-flat-work-group-size attribute.
56

llvm/test/CodeGen/AMDGPU/propagate-waves-per-eu.ll

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --check-attributes --check-globals --version 2
2-
; RUN: opt -S -mtriple=amdgcn-amd-amdhsa -amdgpu-attributor %s | FileCheck %s
2+
; RUN: opt -S -mtriple=amdgcn-amd-amdhsa -passes=amdgpu-attributor %s | FileCheck %s
33

44
; Check propagation of amdgpu-flat-work-group-size attribute.
55

llvm/test/CodeGen/AMDGPU/recursive_global_initializer.ll

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --check-globals --version 2
2-
; RUN: opt -mtriple=amdgcn-amd-amdhsa -amdgpu-attributor -S %s | FileCheck %s
2+
; RUN: opt -mtriple=amdgcn-amd-amdhsa -passes=amdgpu-attributor -S %s | FileCheck %s
33

44
%struct.foo = type { %struct.pluto, ptr, i64 }
55
%struct.pluto = type { [512 x i8], ptr }

llvm/test/CodeGen/AMDGPU/simple-indirect-call.ll

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --function-signature --check-globals
22
; RUN: opt -S -mtriple=amdgcn-amd-amdhsa -amdgpu-annotate-kernel-features %s | FileCheck -check-prefix=AKF_GCN %s
3-
; RUN: opt -S -mtriple=amdgcn-amd-amdhsa -amdgpu-attributor %s | FileCheck -check-prefix=ATTRIBUTOR_GCN %s
3+
; RUN: opt -S -mtriple=amdgcn-amd-amdhsa -passes=amdgpu-attributor %s | FileCheck -check-prefix=ATTRIBUTOR_GCN %s
44

55
; RUN: llc -mtriple=amdgcn-amd-amdhsa -mcpu=gfx900 < %s | FileCheck -check-prefix=GFX9 %s
66

llvm/test/CodeGen/AMDGPU/uniform-work-group-attribute-missing.ll

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --function-signature --check-globals
2-
; RUN: opt -S -mtriple=amdgcn-amd- -amdgpu-attributor %s | FileCheck %s
2+
; RUN: opt -S -mtriple=amdgcn-amd- -passes=amdgpu-attributor %s | FileCheck %s
33

44
; If the kernel does not have the uniform-work-group-attribute, set both callee and caller as false
55
; We write to a global so that the attributor don't deletes the function.

llvm/test/CodeGen/AMDGPU/uniform-work-group-multistep.ll

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --function-signature --check-globals
2-
; RUN: opt -S -mtriple=amdgcn-unknown-unknown -amdgpu-attributor < %s | FileCheck %s
2+
; RUN: opt -S -mtriple=amdgcn-unknown-unknown -passes=amdgpu-attributor < %s | FileCheck %s
33

44
;.
55
; CHECK: @[[G1:[a-zA-Z0-9_$"\\.-]+]] = global ptr null

llvm/test/CodeGen/AMDGPU/uniform-work-group-nested-function-calls.ll

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --function-signature --check-globals
2-
; RUN: opt -S -mtriple=amdgcn-amd- -amdgpu-attributor < %s | FileCheck %s
2+
; RUN: opt -S -mtriple=amdgcn-amd- -passes=amdgpu-attributor < %s | FileCheck %s
33

44
; Test to verify if the attribute gets propagated across nested function calls
55

llvm/test/CodeGen/AMDGPU/uniform-work-group-prevent-attribute-propagation.ll

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --function-signature --check-globals
2-
; RUN: opt -S -mtriple=amdgcn-amd- -amdgpu-attributor < %s | FileCheck %s
2+
; RUN: opt -S -mtriple=amdgcn-amd- -passes=amdgpu-attributor < %s | FileCheck %s
33

44
; Function added to prevent attributor from deleting call sites.
55

llvm/test/CodeGen/AMDGPU/uniform-work-group-propagate-attribute.ll

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --function-signature --check-globals
2-
; RUN: opt -S -mtriple=amdgcn-amd- -amdgpu-attributor %s | FileCheck %s
2+
; RUN: opt -S -mtriple=amdgcn-amd- -passes=amdgpu-attributor %s | FileCheck %s
33

44
@x = global i32 0
55

llvm/test/CodeGen/AMDGPU/uniform-work-group-recursion-test.ll

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --function-signature --check-globals
2-
; RUN: opt -S -mtriple=amdgcn-amd- -amdgpu-attributor %s | FileCheck %s
2+
; RUN: opt -S -mtriple=amdgcn-amd- -passes=amdgpu-attributor %s | FileCheck %s
33

44
; Test to ensure recursive functions exhibit proper behaviour
55
; Test to generate fibonacci numbers

llvm/test/CodeGen/AMDGPU/uniform-work-group-test.ll

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --function-signature --check-globals
2-
; RUN: opt -S -mtriple=amdgcn-amd-amdhsa -amdgpu-attributor %s | FileCheck -allow-unused-prefixes %s
2+
; RUN: opt -S -mtriple=amdgcn-amd-amdhsa -passes=amdgpu-attributor %s | FileCheck -allow-unused-prefixes %s
33

44
@x = global i32 0
55
;.

0 commit comments

Comments
 (0)