Skip to content

Commit 4647b8a

Browse files
committed
[AMDGPU] Enable amdgpu-sw-lower-lds pass in pipeline.
1 parent 1bc8b32 commit 4647b8a

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

llvm/lib/Target/AMDGPU/AMDGPUTargetMachine.cpp

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -342,6 +342,10 @@ static cl::opt<bool, true> EnableLowerModuleLDS(
342342
cl::location(AMDGPUTargetMachine::EnableLowerModuleLDS), cl::init(true),
343343
cl::Hidden);
344344

345+
static cl::opt<bool> EnableSwLowerLDS("amdgpu-enable-sw-lower-lds",
346+
cl::desc("Enable sw lower lds pass"),
347+
cl::init(true), cl::Hidden);
348+
345349
static cl::opt<bool> EnablePreRAOptimizations(
346350
"amdgpu-enable-pre-ra-optimizations",
347351
cl::desc("Enable Pre-RA optimizations pass"), cl::init(true),
@@ -732,6 +736,12 @@ void AMDGPUTargetMachine::registerPassBuilderCallbacks(
732736
PM.addPass(createCGSCCToFunctionPassAdaptor(std::move(FPM)));
733737
});
734738

739+
PB.registerOptimizerLastEPCallback(
740+
[this](ModulePassManager &PM, OptimizationLevel Level) {
741+
if (EnableSwLowerLDS)
742+
PM.addPass(AMDGPUSwLowerLDSPass());
743+
});
744+
735745
PB.registerFullLinkTimeOptimizationLastEPCallback(
736746
[this](ModulePassManager &PM, OptimizationLevel Level) {
737747
// We want to support the -lto-partitions=N option as "best effort".

0 commit comments

Comments
 (0)