diff options
-rw-r--r-- | llvm/lib/Target/NVPTX/NVPTXLowerAlloca.cpp | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/llvm/lib/Target/NVPTX/NVPTXLowerAlloca.cpp b/llvm/lib/Target/NVPTX/NVPTXLowerAlloca.cpp index 945b7286b03..cf488b06f06 100644 --- a/llvm/lib/Target/NVPTX/NVPTXLowerAlloca.cpp +++ b/llvm/lib/Target/NVPTX/NVPTXLowerAlloca.cpp @@ -70,8 +70,7 @@ bool NVPTXLowerAlloca::runOnFunction(Function &F) { for (auto &I : BB) { if (auto allocaInst = dyn_cast<AllocaInst>(&I)) { Changed = true; - auto PTy = dyn_cast<PointerType>(allocaInst->getType()); - auto ETy = PTy->getElementType(); + auto ETy = cast<PointerType>(allocaInst->getType())->getElementType(); auto LocalAddrTy = PointerType::get(ETy, ADDRESS_SPACE_LOCAL); auto NewASCToLocal = new AddrSpaceCastInst(allocaInst, LocalAddrTy, ""); auto GenericAddrTy = PointerType::get(ETy, ADDRESS_SPACE_GENERIC); |