From: Arthur Eubanks Date: Tue, 13 Jul 2021 16:25:28 +0000 (-0700) Subject: [OpaquePtr] Use AllocaInst::getAllocatedType() X-Git-Tag: llvmorg-14-init~1615 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=b25aca503d296eeeb2a174d8fb97637de74b8653;p=platform%2Fupstream%2Fllvm.git [OpaquePtr] Use AllocaInst::getAllocatedType() --- diff --git a/llvm/lib/Target/NVPTX/NVPTXLowerAlloca.cpp b/llvm/lib/Target/NVPTX/NVPTXLowerAlloca.cpp index cf488b06f06c..1bd02552b666 100644 --- a/llvm/lib/Target/NVPTX/NVPTXLowerAlloca.cpp +++ b/llvm/lib/Target/NVPTX/NVPTXLowerAlloca.cpp @@ -70,7 +70,7 @@ bool NVPTXLowerAlloca::runOnFunction(Function &F) { for (auto &I : BB) { if (auto allocaInst = dyn_cast(&I)) { Changed = true; - auto ETy = cast(allocaInst->getType())->getElementType(); + auto ETy = allocaInst->getAllocatedType(); auto LocalAddrTy = PointerType::get(ETy, ADDRESS_SPACE_LOCAL); auto NewASCToLocal = new AddrSpaceCastInst(allocaInst, LocalAddrTy, ""); auto GenericAddrTy = PointerType::get(ETy, ADDRESS_SPACE_GENERIC);