[PATCH] D79212: [SVE] Remove invalid usage of getNumElements in Instructions

Christopher Tetreault via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon May 4 09:05:59 PDT 2020


This revision was automatically updated to reflect the committed changes.
Closed by commit rG3b7f3d012bcd: [SVE] Remove invalid usage of getNumElements in Instructions (authored by ctetreau).

Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D79212

Files:
  llvm/lib/IR/Instructions.cpp


Index: llvm/lib/IR/Instructions.cpp
===================================================================
--- llvm/lib/IR/Instructions.cpp
+++ llvm/lib/IR/Instructions.cpp
@@ -1916,11 +1916,11 @@
 bool ShuffleVectorInst::isValidOperands(const Value *V1, const Value *V2,
                                         ArrayRef<int> Mask) {
   // V1 and V2 must be vectors of the same type.
-  if (!V1->getType()->isVectorTy() || V1->getType() != V2->getType())
+  if (!isa<VectorType>(V1->getType()) || V1->getType() != V2->getType())
     return false;
 
   // Make sure the mask elements make sense.
-  int V1Size = cast<VectorType>(V1->getType())->getNumElements();
+  int V1Size = cast<VectorType>(V1->getType())->getElementCount().Min;
   for (int Elem : Mask)
     if (Elem != UndefMaskElem && Elem >= V1Size * 2)
       return false;


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D79212.261840.patch
Type: text/x-patch
Size: 833 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200504/4f25a8b8/attachment.bin>


More information about the llvm-commits mailing list