File tree 2 files changed +19
-0
lines changed
2 files changed +19
-0
lines changed Original file line number Diff line number Diff line change @@ -383,6 +383,11 @@ static cl::opt<bool> EnableHipStdPar(
383
383
cl::desc (" Enable HIP Standard Parallelism Offload support" ), cl::init(false ),
384
384
cl::Hidden);
385
385
386
+ static cl::opt<bool >
387
+ EnableAMDGPUAttributor (" amdgpu-attributor-enable" ,
388
+ cl::desc (" Enable AMDGPUAttributorPass" ),
389
+ cl::init(true ), cl::Hidden);
390
+
386
391
extern " C" LLVM_EXTERNAL_VISIBILITY void LLVMInitializeAMDGPUTarget () {
387
392
// Register the target
388
393
RegisterTargetMachine<R600TargetMachine> X (getTheR600Target ());
@@ -762,6 +767,8 @@ void AMDGPUTargetMachine::registerPassBuilderCallbacks(PassBuilder &PB) {
762
767
// module is partitioned for codegen.
763
768
if (EnableLowerModuleLDS)
764
769
PM.addPass (AMDGPULowerModuleLDSPass (*this ));
770
+ if (EnableAMDGPUAttributor && Level != OptimizationLevel::O0)
771
+ PM.addPass (AMDGPUAttributorPass (*this ));
765
772
});
766
773
767
774
PB.registerRegClassFilterParsingCallback (
Original file line number Diff line number Diff line change
1
+ ; RUN: opt -mtriple=amdgcn--amdhsa -S -passes="lto<O0>" -print-pipeline-passes %s -o - | FileCheck --check-prefix=O0 %s
2
+ ; RUN: opt -mtriple=amdgcn--amdhsa -S -passes="lto<O1>" -print-pipeline-passes %s -o - | FileCheck %s
3
+ ; RUN: opt -mtriple=amdgcn--amdhsa -S -passes="lto<O2>" -print-pipeline-passes %s -o - | FileCheck %s
4
+ ; RUN: opt -mtriple=amdgcn--amdhsa -S -passes="lto<O3>" -print-pipeline-passes %s -o - | FileCheck %s
5
+
6
+ ; CHECK: amdgpu-attributor
7
+ ; O0-NOT: amdgpu-attributor
8
+
9
+ define amdgpu_kernel void @kernel () {
10
+ entry:
11
+ ret void
12
+ }
You can’t perform that action at this time.
0 commit comments