[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
Fri May 29 15:54:08 PDT 2020


This revision was automatically updated to reflect the committed changes.
Closed by commit rGe6cf402e8364: [SVE] Eliminate calls to default-false VectorType::get() from… (authored by ctetreau).

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D80332/new/

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.267398.patch
Type: text/x-patch
Size: 756 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200529/1302c09d/attachment.bin>


More information about the llvm-commits mailing list