[Polly] Fix deprecation warning. NFC.
IRBuilder::CreateLoad without type parameter was deprecated in 6312c538
to prepare for opaque pointers.
GitOrigin-RevId: 9c486eb34894d077fabf590c7d0c23aab2ad8bb2
diff --git a/lib/CodeGen/ManagedMemoryRewrite.cpp b/lib/CodeGen/ManagedMemoryRewrite.cpp
index 64bfa8d..3545638 100644
--- a/lib/CodeGen/ManagedMemoryRewrite.cpp
+++ b/lib/CodeGen/ManagedMemoryRewrite.cpp
@@ -256,7 +256,8 @@
Builder.SetInsertPoint(UserOfArrayInst);
// <ty>** -> <ty>*
- Value *ArrPtrLoaded = Builder.CreateLoad(ReplacementToArr, "arrptr.load");
+ Value *ArrPtrLoaded =
+ Builder.CreateLoad(ElemPtrTy, ReplacementToArr, "arrptr.load");
// <ty>* -> [ty]*
Value *ArrPtrLoadedBitcasted = Builder.CreateBitCast(
ArrPtrLoaded, ArrayTy->getPointerTo(), "arrptr.bitcast");
diff --git a/lib/CodeGen/PPCGCodeGeneration.cpp b/lib/CodeGen/PPCGCodeGeneration.cpp
index 53818a4..af5e91f 100644
--- a/lib/CodeGen/PPCGCodeGeneration.cpp
+++ b/lib/CodeGen/PPCGCodeGeneration.cpp
@@ -1317,12 +1317,13 @@
isl_ast_expr *Index = isl_ast_expr_copy(KernelStmt->u.c.index);
Index = isl_ast_expr_address_of(Index);
Value *GlobalAddr = ExprBuilder.create(Index);
+ Type *IndexTy = cast<PointerType>(GlobalAddr->getType())->getElementType();
if (KernelStmt->u.c.read) {
- LoadInst *Load = Builder.CreateLoad(GlobalAddr, "shared.read");
+ LoadInst *Load = Builder.CreateLoad(IndexTy, GlobalAddr, "shared.read");
Builder.CreateStore(Load, LocalAddr);
} else {
- LoadInst *Load = Builder.CreateLoad(LocalAddr, "shared.write");
+ LoadInst *Load = Builder.CreateLoad(IndexTy, LocalAddr, "shared.write");
Builder.CreateStore(Load, GlobalAddr);
}
}
@@ -2177,7 +2178,7 @@
if (!gpu_array_is_read_only_scalar(&Prog->array[i])) {
Type *TypePtr = SAI->getElementType()->getPointerTo();
Value *TypedArgPtr = Builder.CreatePointerCast(Val, TypePtr);
- Val = Builder.CreateLoad(TypedArgPtr);
+ Val = Builder.CreateLoad(SAI->getElementType(), TypedArgPtr);
}
Value *Alloca = BlockGen.getOrCreateAlloca(SAI);
@@ -2214,7 +2215,7 @@
Value *ArgPtr = &*Arg;
Type *TypePtr = SAI->getElementType()->getPointerTo();
Value *TypedArgPtr = Builder.CreatePointerCast(ArgPtr, TypePtr);
- Value *Val = Builder.CreateLoad(Alloca);
+ Value *Val = Builder.CreateLoad(SAI->getElementType(), Alloca);
Builder.CreateStore(Val, TypedArgPtr);
StoredScalar = true;