Reviewers: efriedma, aymanmus, c-rhodes, david-arm
Reviewed By: david-arm
Subscribers: tschuett, hiraditya, rkruppe, psnobl, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D80332
/// version of \p Ty, otherwise return \p Ty.
static Type *getReducedType(Value *V, Type *Ty) {
assert(Ty && !Ty->isVectorTy() && "Expect Scalar Type");
- if (auto *VTy = dyn_cast<VectorType>(V->getType()))
- return VectorType::get(Ty, VTy->getNumElements());
+ if (auto *VTy = dyn_cast<VectorType>(V->getType())) {
+ // FIXME: should this handle scalable vectors?
+ return FixedVectorType::get(Ty, VTy->getNumElements());
+ }
return Ty;
}