Skip to content

Commit f58c9b1

Browse files
committed
[SWDEV-409372] [AMDGPU] Enable amdgpu-sw-lower-lds pass in pipeline.
Change-Id: I27892d185033523ba93bcf4b59f1dd671f426301
1 parent 341d64e commit f58c9b1

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
@@ -382,6 +382,12 @@ static cl::opt<bool> EnableStructurizerWorkarounds(
382382
cl::desc("Enable workarounds for the StructurizeCFG pass"), cl::init(true),
383383
cl::Hidden);
384384

385+
static cl::opt<bool>
386+
EnableSwLowerLDS("amdgpu-enable-sw-lower-lds",
387+
cl::desc("Enable lowering of lds to global memory pass "
388+
"and asan instrument resulting IR."),
389+
cl::init(true), cl::Hidden);
390+
385391
static cl::opt<bool, true> EnableLowerModuleLDS(
386392
"amdgpu-enable-lower-module-lds", cl::desc("Enable lower module lds pass"),
387393
cl::location(AMDGPUTargetMachine::EnableLowerModuleLDS), cl::init(true),
@@ -1148,6 +1154,10 @@ void AMDGPUPassConfig::addIRPasses() {
11481154
// Replace OpenCL enqueued block function pointers with global variables.
11491155
addPass(createAMDGPUOpenCLEnqueuedBlockLoweringPass());
11501156

1157+
// Lower LDS accesses to global memory if address sanitizer is enabled.
1158+
if (EnableSwLowerLDS)
1159+
addPass(createAMDGPUSwLowerLDSLegacyPass(&TM));
1160+
11511161
// Runs before PromoteAlloca so the latter can account for function uses
11521162
if (EnableLowerModuleLDS) {
11531163
addPass(createAMDGPULowerModuleLDSLegacyPass(&TM));

0 commit comments

Comments
 (0)