[PATCH] D82218: [SVE] Remove calls to VectorType::getNumElements from AggressiveInstCombine

Christopher Tetreault via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jun 19 10:53:02 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.

Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D82218

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
@@ -291,7 +291,8 @@
   assert(Ty && !Ty->isVectorTy() && "Expect Scalar Type");
   if (auto *VTy = dyn_cast<VectorType>(V->getType())) {
     // FIXME: should this handle scalable vectors?
-    return FixedVectorType::get(Ty, VTy->getNumElements());
+    return FixedVectorType::get(Ty,
+                                cast<FixedVectorType>(VTy)->getNumElements());
   }
   return Ty;
 }


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D82218.272137.patch
Type: text/x-patch
Size: 661 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200619/af53fc65/attachment.bin>


More information about the llvm-commits mailing list