[PATCH] D80616: [CodeGen] Fix warnings in getZeroExtendInReg

David Sherwood via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed May 27 03:12:16 PDT 2020


david-arm created this revision.
david-arm added reviewers: sdesmalen, c-rhodes, ctetreau.
Herald added subscribers: llvm-commits, hiraditya, kristof.beyls.
Herald added a reviewer: rengolin.
Herald added a project: LLVM.

We should be using getVectorElementCount() to assert that two types
have the same numbers of elements. I encountered the warnings while
compiling this test:

  CodeGen/AArch64/sve-intrinsics-ld1.ll


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D80616

Files:
  llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp


Index: llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
===================================================================
--- llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
+++ llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
@@ -1174,7 +1174,7 @@
          "getZeroExtendInReg type should be vector iff the operand "
          "type is vector!");
   assert((!VT.isVector() ||
-          VT.getVectorNumElements() == OpVT.getVectorNumElements()) &&
+          VT.getVectorElementCount() == OpVT.getVectorElementCount()) &&
          "Vector element counts must match in getZeroExtendInReg");
   assert(VT.bitsLE(OpVT) && "Not extending!");
   if (OpVT == VT)


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D80616.266464.patch
Type: text/x-patch
Size: 657 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200527/12a39129/attachment.bin>


More information about the llvm-commits mailing list