[CodeGen] Fix warnings in getZeroExtendInReg
authorDavid Sherwood <david.sherwood@arm.com>
Wed, 27 May 2020 09:36:25 +0000 (10:36 +0100)
committerDavid Sherwood <david.sherwood@arm.com>
Fri, 29 May 2020 10:51:07 +0000 (11:51 +0100)
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

Differential Revision: https://reviews.llvm.org/D80616

llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp

index 2f277ee..bd1a5a4 100644 (file)
@@ -1175,7 +1175,7 @@ SDValue SelectionDAG::getZeroExtendInReg(SDValue Op, const SDLoc &DL, EVT VT) {
          "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)