[PATCH] D80332: [SVE] Eliminate calls to default-false VectorType::get() from AggressiveInstCombine
Christopher Tetreault via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed May 20 16:00:50 PDT 2020
ctetreau created this revision.
Herald added subscribers: llvm-commits, psnobl, rkruppe, hiraditya, tschuett.
Herald added a reviewer: efriedma.
Herald added a project: LLVM.
ctetreau added reviewers: aymanmus, c-rhodes, david-arm.
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D80332
Files:
llvm/lib/Transforms/AggressiveInstCombine/TruncInstCombine.cpp
Index: llvm/lib/Transforms/AggressiveInstCombine/TruncInstCombine.cpp
===================================================================
--- llvm/lib/Transforms/AggressiveInstCombine/TruncInstCombine.cpp
+++ llvm/lib/Transforms/AggressiveInstCombine/TruncInstCombine.cpp
@@ -281,8 +281,10 @@
/// 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;
}
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D80332.265363.patch
Type: text/x-patch
Size: 756 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200520/e3840e4d/attachment.bin>
More information about the llvm-commits
mailing list