diff options
author | Nikita Popov <npopov@redhat.com> | 2022-02-14 10:22:41 +0100 |
---|---|---|
committer | Nikita Popov <npopov@redhat.com> | 2022-02-14 10:23:36 +0100 |
commit | ee423d93ead39e94c2970b3cc7ef6e6faa75d10b (patch) | |
tree | 07532e5f83e3bbe94545039b57060fb65481a56c /polly | |
parent | 07153f7e072d86e374abfab22b71f9601643d175 (diff) | |
download | llvm-ee423d93ead39e94c2970b3cc7ef6e6faa75d10b.zip llvm-ee423d93ead39e94c2970b3cc7ef6e6faa75d10b.tar.gz llvm-ee423d93ead39e94c2970b3cc7ef6e6faa75d10b.tar.bz2 |
[polly] Remove uses of PointerType::getElementType()
This method has been removed. I missed these uses in conditionally-
compiled code previously.
Diffstat (limited to 'polly')
-rw-r--r-- | polly/lib/CodeGen/ManagedMemoryRewrite.cpp | 5 | ||||
-rw-r--r-- | 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<GlobalVariable *, 4> &ReplacedGlobals) { // We only want arrays. - ArrayType *ArrayTy = dyn_cast<ArrayType>(Array.getType()->getElementType()); + ArrayType *ArrayTy = dyn_cast<ArrayType>(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<PointerType>(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 (<func-type>*) among operands of Inst if (auto PtrTy = dyn_cast<PointerType>(Op->getType())) { - if (isa<FunctionType>(PtrTy->getElementType())) { + if (isa<FunctionType>(PtrTy->getPointerElementType())) { LLVM_DEBUG(dbgs() << Inst << " has illegal use of function in kernel.\n"); return true; |