[PATCH] D80634: [SVE] Fix warnings in SelectInst::areInvalidOperands

David Sherwood via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed May 27 07:33:15 PDT 2020


david-arm created this revision.
david-arm added reviewers: sdesmalen, kmclaughlin, ctetreau.
Herald added subscribers: llvm-commits, psnobl, rkruppe, hiraditya, tschuett.
Herald added a reviewer: efriedma.
Herald added a project: LLVM.

We should be comparing the element counts rather than the
numbers of elements.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D80634

Files:
  llvm/lib/IR/Instructions.cpp


Index: llvm/lib/IR/Instructions.cpp
===================================================================
--- llvm/lib/IR/Instructions.cpp
+++ llvm/lib/IR/Instructions.cpp
@@ -81,7 +81,7 @@
     VectorType *ET = dyn_cast<VectorType>(Op1->getType());
     if (!ET)
       return "selected values for vector select must be vectors";
-    if (ET->getNumElements() != VT->getNumElements())
+    if (ET->getElementCount() != VT->getElementCount())
       return "vector select requires selected vectors to have "
                    "the same vector length as select condition";
   } else if (Op0->getType() != Type::getInt1Ty(Op0->getContext())) {


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D80634.266532.patch
Type: text/x-patch
Size: 642 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200527/8e67534b/attachment-0001.bin>


More information about the llvm-commits mailing list