File tree Expand file tree Collapse file tree 2 files changed +19
-0
lines changed Expand file tree Collapse file tree 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(
383383 cl::desc (" Enable HIP Standard Parallelism Offload support" ), cl::init(false ),
384384 cl::Hidden);
385385
386+ static cl::opt<bool >
387+ EnableAMDGPUAttributor (" amdgpu-attributor-enable" ,
388+ cl::desc (" Enable AMDGPUAttributorPass" ),
389+ cl::init(true ), cl::Hidden);
390+
386391extern " C" LLVM_EXTERNAL_VISIBILITY void LLVMInitializeAMDGPUTarget () {
387392 // Register the target
388393 RegisterTargetMachine<R600TargetMachine> X (getTheR600Target ());
@@ -762,6 +767,8 @@ void AMDGPUTargetMachine::registerPassBuilderCallbacks(PassBuilder &PB) {
762767 // module is partitioned for codegen.
763768 if (EnableLowerModuleLDS)
764769 PM.addPass (AMDGPULowerModuleLDSPass (*this ));
770+ if (EnableAMDGPUAttributor && Level != OptimizationLevel::O0)
771+ PM.addPass (AMDGPUAttributorPass (*this ));
765772 });
766773
767774 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