File tree Expand file tree Collapse file tree 1 file changed +10
-0
lines changed Expand file tree Collapse file tree 1 file changed +10
-0
lines changed Original file line number Diff line number Diff 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+
385391static 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));
You can’t perform that action at this time.
0 commit comments