From ee423d93ead39e94c2970b3cc7ef6e6faa75d10b Mon Sep 17 00:00:00 2001 From: Nikita Popov Date: Mon, 14 Feb 2022 10:22:41 +0100 Subject: [PATCH] [polly] Remove uses of PointerType::getElementType() This method has been removed. I missed these uses in conditionally- compiled code previously. --- polly/lib/CodeGen/ManagedMemoryRewrite.cpp | 5 ++--- polly/lib/CodeGen/PPCGCodeGeneration.cpp | 4 ++-- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/polly/lib/CodeGen/ManagedMemoryRewrite.cpp b/polly/lib/CodeGen/ManagedMemoryRewrite.cpp index 3545638..449a4b5 100644 --- a/polly/lib/CodeGen/ManagedMemoryRewrite.cpp +++ b/polly/lib/CodeGen/ManagedMemoryRewrite.cpp @@ -180,7 +180,7 @@ static void replaceGlobalArray(Module &M, const DataLayout &DL, GlobalVariable &Array, SmallPtrSet &ReplacedGlobals) { // We only want arrays. - ArrayType *ArrayTy = dyn_cast(Array.getType()->getElementType()); + ArrayType *ArrayTy = dyn_cast(Array.getValueType()); if (!ArrayTy) return; Type *ElemTy = ArrayTy->getElementType(); @@ -298,8 +298,7 @@ static void rewriteAllocaAsManagedMemory(AllocaInst *Alloca, Function *MallocManagedFn = getOrCreatePollyMallocManaged(*Alloca->getModule()); - const uint64_t Size = - DL.getTypeAllocSize(Alloca->getType()->getElementType()); + const uint64_t Size = DL.getTypeAllocSize(Alloca->getAllocatedType()); Value *SizeVal = Builder.getInt64(Size); Value *RawManagedMem = Builder.CreateCall(MallocManagedFn, {SizeVal}); Value *Bitcasted = Builder.CreateBitCast(RawManagedMem, Alloca->getType()); diff --git a/polly/lib/CodeGen/PPCGCodeGeneration.cpp b/polly/lib/CodeGen/PPCGCodeGeneration.cpp index a10a531..bd5674d 100644 --- a/polly/lib/CodeGen/PPCGCodeGeneration.cpp +++ b/polly/lib/CodeGen/PPCGCodeGeneration.cpp @@ -1318,7 +1318,7 @@ 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(GlobalAddr->getType())->getElementType(); + Type *IndexTy = GlobalAddr->getType()->getPointerElementType(); if (KernelStmt->u.c.read) { LoadInst *Load = Builder.CreateLoad(IndexTy, GlobalAddr, "shared.read"); @@ -3445,7 +3445,7 @@ public: for (Value *Op : Inst.operands()) // Look for (*) among operands of Inst if (auto PtrTy = dyn_cast(Op->getType())) { - if (isa(PtrTy->getElementType())) { + if (isa(PtrTy->getPointerElementType())) { LLVM_DEBUG(dbgs() << Inst << " has illegal use of function in kernel.\n"); return true; -- 2.7.4