diff --git a/llvm/lib/Target/AMDGPU/AMDGPULowerModuleLDSPass.cpp b/llvm/lib/Target/AMDGPU/AMDGPULowerModuleLDSPass.cpp --- a/llvm/lib/Target/AMDGPU/AMDGPULowerModuleLDSPass.cpp +++ b/llvm/lib/Target/AMDGPU/AMDGPULowerModuleLDSPass.cpp @@ -216,16 +216,6 @@ std::vector KernelUsedVariables = AMDGPU::findLDSVariablesToLower(M, &F); - // Replace all constant uses with instructions if they belong to the - // current kernel. Unnecessary, removing will cause test churn. - for (GlobalVariable *GV : KernelUsedVariables) { - for (User *U : make_early_inc_range(GV->users())) { - if (ConstantExpr *C = dyn_cast(U)) - AMDGPU::replaceConstantUsesInFunction(C, &F); - } - GV->removeDeadConstantUsers(); - } - if (!KernelUsedVariables.empty()) { std::string VarName = (Twine("llvm.amdgcn.kernel.") + F.getName() + ".lds").str();