diff --git a/llvm/lib/Target/Hexagon/HexagonISelLowering.cpp b/llvm/lib/Target/Hexagon/HexagonISelLowering.cpp --- a/llvm/lib/Target/Hexagon/HexagonISelLowering.cpp +++ b/llvm/lib/Target/Hexagon/HexagonISelLowering.cpp @@ -1087,7 +1087,7 @@ Constant *CVal = nullptr; bool isVTi1Type = false; if (auto *CV = dyn_cast(CPN->getConstVal())) { - if (CV->getType()->getVectorElementType()->isIntegerTy(1)) { + if (cast(CV->getType())->getElementType()->isIntegerTy(1)) { IRBuilder<> IRB(CV->getContext()); SmallVector NewConst; unsigned VecLen = CV->getNumOperands(); diff --git a/llvm/lib/Target/Hexagon/HexagonTargetTransformInfo.cpp b/llvm/lib/Target/Hexagon/HexagonTargetTransformInfo.cpp --- a/llvm/lib/Target/Hexagon/HexagonTargetTransformInfo.cpp +++ b/llvm/lib/Target/Hexagon/HexagonTargetTransformInfo.cpp @@ -60,8 +60,8 @@ } unsigned HexagonTTIImpl::getTypeNumElements(Type *Ty) const { - if (Ty->isVectorTy()) - return Ty->getVectorNumElements(); + if (auto *VTy = dyn_cast(Ty)) + return VTy->getNumElements(); assert((Ty->isIntegerTy() || Ty->isFloatingPointTy()) && "Expecting scalar type"); return 1;