forked from OSchip/llvm-project
[SVE] Eliminate calls to default-false VectorType::get() from AggressiveInstCombine
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
This commit is contained in:
parent
56eb7556e7
commit
e6cf402e83
|
@ -281,8 +281,10 @@ Type *TruncInstCombine::getBestTruncatedType() {
|
|||
/// 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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue