[PATCH] D80555: [CodeGen] Fix warning in changeVectorElementTypeToInteger

David Sherwood via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue May 26 07:00:55 PDT 2020


david-arm created this revision.
david-arm added reviewers: sdesmalen, kmclaughlin, ctetreau.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

When creating vectors with MVT::getVectorVT we should be using
getVectorElementCount() instead of getVectorNumElements().


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D80555

Files:
  llvm/include/llvm/CodeGen/ValueTypes.h


Index: llvm/include/llvm/CodeGen/ValueTypes.h
===================================================================
--- llvm/include/llvm/CodeGen/ValueTypes.h
+++ llvm/include/llvm/CodeGen/ValueTypes.h
@@ -97,8 +97,7 @@
       MVT EltTy = getSimpleVT().getVectorElementType();
       unsigned BitWidth = EltTy.getSizeInBits();
       MVT IntTy = MVT::getIntegerVT(BitWidth);
-      MVT VecTy = MVT::getVectorVT(IntTy, getVectorNumElements(),
-                                   isScalableVector());
+      MVT VecTy = MVT::getVectorVT(IntTy, getVectorElementCount());
       assert(VecTy.SimpleTy != MVT::INVALID_SIMPLE_VALUE_TYPE &&
              "Simple vector VT not representable by simple integer vector VT!");
       return VecTy;


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D80555.266199.patch
Type: text/x-patch
Size: 735 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200526/e462513b/attachment.bin>


More information about the llvm-commits mailing list