diff options
Diffstat (limited to 'contrib/llvm-project/llvm/lib/Target/AMDGPU/AMDGPULowerKernelAttributes.cpp')
-rw-r--r-- | contrib/llvm-project/llvm/lib/Target/AMDGPU/AMDGPULowerKernelAttributes.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/contrib/llvm-project/llvm/lib/Target/AMDGPU/AMDGPULowerKernelAttributes.cpp b/contrib/llvm-project/llvm/lib/Target/AMDGPU/AMDGPULowerKernelAttributes.cpp index 26074cf06071..097722157d41 100644 --- a/contrib/llvm-project/llvm/lib/Target/AMDGPU/AMDGPULowerKernelAttributes.cpp +++ b/contrib/llvm-project/llvm/lib/Target/AMDGPU/AMDGPULowerKernelAttributes.cpp @@ -14,6 +14,7 @@ #include "AMDGPU.h" #include "Utils/AMDGPUBaseInfo.h" +#include "llvm/Analysis/ConstantFolding.h" #include "llvm/Analysis/ValueTracking.h" #include "llvm/CodeGen/Passes.h" #include "llvm/CodeGen/TargetPassConfig.h" @@ -286,8 +287,8 @@ static bool processUse(CallInst *CI, bool IsV5OrAbove) { if (HasReqdWorkGroupSize) { ConstantInt *KnownSize = mdconst::extract<ConstantInt>(MD->getOperand(I)); - UMin->replaceAllUsesWith(ConstantExpr::getIntegerCast( - KnownSize, UMin->getType(), false)); + UMin->replaceAllUsesWith(ConstantFoldIntegerCast( + KnownSize, UMin->getType(), false, DL)); } else { UMin->replaceAllUsesWith(ZextGroupSize); } @@ -310,7 +311,7 @@ static bool processUse(CallInst *CI, bool IsV5OrAbove) { ConstantInt *KnownSize = mdconst::extract<ConstantInt>(MD->getOperand(I)); GroupSize->replaceAllUsesWith( - ConstantExpr::getIntegerCast(KnownSize, GroupSize->getType(), false)); + ConstantFoldIntegerCast(KnownSize, GroupSize->getType(), false, DL)); MadeChange = true; } |