[polly] 9c486eb - [Polly] Fix deprecation warning. NFC.
Michael Kruse via llvm-commits
llvm-commits at lists.llvm.org
Mon Mar 15 12:32:38 PDT 2021
Author: Michael Kruse
Date: 2021-03-15T14:31:16-05:00
New Revision: 9c486eb34894d077fabf590c7d0c23aab2ad8bb2
URL: https://github.com/llvm/llvm-project/commit/9c486eb34894d077fabf590c7d0c23aab2ad8bb2
DIFF: https://github.com/llvm/llvm-project/commit/9c486eb34894d077fabf590c7d0c23aab2ad8bb2.diff
LOG: [Polly] Fix deprecation warning. NFC.
IRBuilder::CreateLoad without type parameter was deprecated in 6312c538
to prepare for opaque pointers.
Added:
Modified:
polly/lib/CodeGen/ManagedMemoryRewrite.cpp
polly/lib/CodeGen/PPCGCodeGeneration.cpp
Removed:
################################################################################
diff --git a/polly/lib/CodeGen/ManagedMemoryRewrite.cpp b/polly/lib/CodeGen/ManagedMemoryRewrite.cpp
index 64bfa8dd8b1b..35456388e56b 100644
--- a/polly/lib/CodeGen/ManagedMemoryRewrite.cpp
+++ b/polly/lib/CodeGen/ManagedMemoryRewrite.cpp
@@ -256,7 +256,8 @@ replaceGlobalArray(Module &M, const DataLayout &DL, GlobalVariable &Array,
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/polly/lib/CodeGen/PPCGCodeGeneration.cpp b/polly/lib/CodeGen/PPCGCodeGeneration.cpp
index 53818a4097ee..af5e91f83ef5 100644
--- a/polly/lib/CodeGen/PPCGCodeGeneration.cpp
+++ b/polly/lib/CodeGen/PPCGCodeGeneration.cpp
@@ -1317,12 +1317,13 @@ void GPUNodeBuilder::createKernelCopy(ppcg_kernel_stmt *KernelStmt) {
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 @@ void GPUNodeBuilder::prepareKernelArguments(ppcg_kernel *Kernel, Function *FN) {
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 @@ void GPUNodeBuilder::finalizeKernelArguments(ppcg_kernel *Kernel) {
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;
More information about the llvm-commits
mailing list