Index: lib/Target/AMDGPU/AMDGPUTargetMachine.cpp =================================================================== --- lib/Target/AMDGPU/AMDGPUTargetMachine.cpp +++ lib/Target/AMDGPU/AMDGPUTargetMachine.cpp @@ -62,6 +62,12 @@ cl::ReallyHidden, cl::init(true)); +static cl::opt EnablePromoteAlloca( + "amdgpu-enable-promote-alloca", + cl::desc("Run promote alloca pass"), + cl::ReallyHidden, + cl::init(true)); + static cl::opt EnableEarlyIfConversion("amdgpu-early-ifcvt", cl::Hidden, cl::desc("Run early if-conversion"), @@ -653,7 +659,8 @@ if (TM.getOptLevel() > CodeGenOpt::None) { addPass(createInferAddressSpacesPass()); - addPass(createAMDGPUPromoteAlloca()); + if (EnablePromoteAlloca) + addPass(createAMDGPUPromoteAlloca()); if (EnableSROA) addPass(createSROAPass());