diff --git a/llvm/lib/Transforms/AggressiveInstCombine/TruncInstCombine.cpp b/llvm/lib/Transforms/AggressiveInstCombine/TruncInstCombine.cpp --- a/llvm/lib/Transforms/AggressiveInstCombine/TruncInstCombine.cpp +++ b/llvm/lib/Transforms/AggressiveInstCombine/TruncInstCombine.cpp @@ -291,7 +291,8 @@ assert(Ty && !Ty->isVectorTy() && "Expect Scalar Type"); if (auto *VTy = dyn_cast(V->getType())) { // FIXME: should this handle scalable vectors? - return FixedVectorType::get(Ty, VTy->getNumElements()); + return FixedVectorType::get(Ty, + cast(VTy)->getNumElements()); } return Ty; }