[polly] 0ce9acf - [polly] Fix uses of deprecated overload of IRBuilder::CreateGEP.
Eli Friedman via llvm-commits
llvm-commits at lists.llvm.org
Sun Jul 18 18:43:30 PDT 2021
Author: Eli Friedman
Date: 2021-07-18T18:43:01-07:00
New Revision: 0ce9acf61d0c6e7a785225975638a9941a009a0d
URL: https://github.com/llvm/llvm-project/commit/0ce9acf61d0c6e7a785225975638a9941a009a0d
DIFF: https://github.com/llvm/llvm-project/commit/0ce9acf61d0c6e7a785225975638a9941a009a0d.diff
LOG: [polly] Fix uses of deprecated overload of IRBuilder::CreateGEP.
Added:
Modified:
polly/lib/CodeGen/PPCGCodeGeneration.cpp
Removed:
################################################################################
diff --git a/polly/lib/CodeGen/PPCGCodeGeneration.cpp b/polly/lib/CodeGen/PPCGCodeGeneration.cpp
index 4c47e396131e..77886f1a77da 100644
--- a/polly/lib/CodeGen/PPCGCodeGeneration.cpp
+++ b/polly/lib/CodeGen/PPCGCodeGeneration.cpp
@@ -847,7 +847,7 @@ void GPUNodeBuilder::prepareManagedDeviceArrays() {
if (Offset) {
HostPtr = Builder.CreatePointerCast(
HostPtr, ScopArray->getElementType()->getPointerTo());
- HostPtr = Builder.CreateGEP(HostPtr, Offset);
+ HostPtr = Builder.CreateGEP(ScopArray->getElementType(), HostPtr, Offset);
}
HostPtr = Builder.CreatePointerCast(HostPtr, Builder.getInt8PtrTy());
@@ -1211,7 +1211,7 @@ void GPUNodeBuilder::createDataTransfer(__isl_take isl_ast_node *TransferStmt,
if (Offset) {
HostPtr = Builder.CreatePointerCast(
HostPtr, ScopArray->getElementType()->getPointerTo());
- HostPtr = Builder.CreateGEP(HostPtr, Offset);
+ HostPtr = Builder.CreateGEP(ScopArray->getElementType(), HostPtr, Offset);
}
HostPtr = Builder.CreatePointerCast(HostPtr, Builder.getInt8PtrTy());
@@ -1627,7 +1627,8 @@ GPUNodeBuilder::getBlockSizes(ppcg_kernel *Kernel) {
void GPUNodeBuilder::insertStoreParameter(Instruction *Parameters,
Instruction *Param, int Index) {
Value *Slot = Builder.CreateGEP(
- Parameters, {Builder.getInt64(0), Builder.getInt64(Index)});
+ Parameters->getType()->getPointerElementType(), Parameters,
+ {Builder.getInt64(0), Builder.getInt64(Index)});
Value *ParamTyped = Builder.CreatePointerCast(Param, Builder.getInt8PtrTy());
Builder.CreateStore(ParamTyped, Slot);
}
@@ -1681,11 +1682,12 @@ GPUNodeBuilder::createLaunchParameters(ppcg_kernel *Kernel, Function *F,
if (Offset) {
DevArray = Builder.CreatePointerCast(
DevArray, SAI->getElementType()->getPointerTo());
- DevArray = Builder.CreateGEP(DevArray, Builder.CreateNeg(Offset));
+ DevArray = Builder.CreateGEP(SAI->getElementType(), DevArray,
+ Builder.CreateNeg(Offset));
DevArray = Builder.CreatePointerCast(DevArray, Builder.getInt8PtrTy());
}
Value *Slot = Builder.CreateGEP(
- Parameters, {Builder.getInt64(0), Builder.getInt64(Index)});
+ ArrayTy, Parameters, {Builder.getInt64(0), Builder.getInt64(Index)});
if (gpu_array_is_read_only_scalar(&Prog->array[i])) {
Value *ValPtr = nullptr;
More information about the llvm-commits
mailing list