[X86] LowerAVXExtend - fix dodgy self-comparison assert.
authorSimon Pilgrim <llvm-dev@redking.me.uk>
Wed, 6 Nov 2019 12:50:09 +0000 (12:50 +0000)
committerSimon Pilgrim <llvm-dev@redking.me.uk>
Wed, 6 Nov 2019 12:50:29 +0000 (12:50 +0000)
PVS Studio noticed that we were asserting "VT.getVectorNumElements() == VT.getVectorNumElements()" instead of "VT.getVectorNumElements() == InVT.getVectorNumElements()".

llvm/lib/Target/X86/X86ISelLowering.cpp

index 1ea147c..d1ed862 100644 (file)
@@ -19035,7 +19035,7 @@ static SDValue LowerAVXExtend(SDValue Op, SelectionDAG &DAG,
   assert(VT.isVector() && InVT.isVector() && "Expected vector type");
   assert((Opc == ISD::ANY_EXTEND || Opc == ISD::ZERO_EXTEND) &&
          "Unexpected extension opcode");
-  assert(VT.getVectorNumElements() == VT.getVectorNumElements() &&
+  assert(VT.getVectorNumElements() == InVT.getVectorNumElements() &&
          "Expected same number of elements");
   assert((VT.getVectorElementType() == MVT::i16 ||
           VT.getVectorElementType() == MVT::i32 ||