[PATCH] D79524: [SVE] Fix incorrect usage of getNumElements() in InstCombineCalls

Christopher Tetreault via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu May 7 09:05:40 PDT 2020


This revision was automatically updated to reflect the committed changes.
Closed by commit rGb6c6bab9a5b4: [SVE] Fix incorrect usage of getNumElements() in InstCombineCalls (authored by ctetreau).

Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D79524

Files:
  llvm/lib/Transforms/InstCombine/InstCombineCalls.cpp


Index: llvm/lib/Transforms/InstCombine/InstCombineCalls.cpp
===================================================================
--- llvm/lib/Transforms/InstCombine/InstCombineCalls.cpp
+++ llvm/lib/Transforms/InstCombine/InstCombineCalls.cpp
@@ -1942,9 +1942,10 @@
     if (Changed) return II;
   }
 
-  // For vector result intrinsics, use the generic demanded vector support.
-  if (auto *IIVTy = dyn_cast<VectorType>(II->getType())) {
-    auto VWidth = IIVTy->getNumElements();
+  // For fixed width vector result intrinsics, use the generic demanded vector
+  // support.
+  if (auto *IIFVTy = dyn_cast<FixedVectorType>(II->getType())) {
+    auto VWidth = IIFVTy->getNumElements();
     APInt UndefElts(VWidth, 0);
     APInt AllOnesEltMask(APInt::getAllOnesValue(VWidth));
     if (Value *V = SimplifyDemandedVectorElts(II, AllOnesEltMask, UndefElts)) {


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D79524.262673.patch
Type: text/x-patch
Size: 861 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200507/3ba6f08c/attachment.bin>


More information about the llvm-commits mailing list