Skip to content

Commit

Permalink
[Polly] Fix deprecation warning. NFC.
Browse files Browse the repository at this point in the history
IRBuilder::CreateLoad without type parameter was deprecated in 6312c53
to prepare for opaque pointers.
  • Loading branch information
Meinersbur committed Mar 15, 2021
1 parent a5d3042 commit 9c486eb
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
3 changes: 2 additions & 1 deletion polly/lib/CodeGen/ManagedMemoryRewrite.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down
9 changes: 5 additions & 4 deletions polly/lib/CodeGen/PPCGCodeGeneration.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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;

Expand Down

0 comments on commit 9c486eb

Please sign in to comment.