[llvm] r292921 - Fix unused variable warning

Simon Pilgrim via llvm-commits llvm-commits at lists.llvm.org
Tue Jan 24 03:54:28 PST 2017


Author: rksimon
Date: Tue Jan 24 05:54:27 2017
New Revision: 292921

URL: http://llvm.org/viewvc/llvm-project?rev=292921&view=rev
Log:
Fix unused variable warning

Modified:
    llvm/trunk/lib/Target/X86/X86ISelLowering.cpp

Modified: llvm/trunk/lib/Target/X86/X86ISelLowering.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86ISelLowering.cpp?rev=292921&r1=292920&r2=292921&view=diff
==============================================================================
--- llvm/trunk/lib/Target/X86/X86ISelLowering.cpp (original)
+++ llvm/trunk/lib/Target/X86/X86ISelLowering.cpp Tue Jan 24 05:54:27 2017
@@ -30469,7 +30469,6 @@ static SDValue combineVectorShift(SDNode
          "Unexpected shift opcode");
   bool LogicalShift = X86ISD::VSHLI == Opcode || X86ISD::VSRLI == Opcode;
   EVT VT = N->getValueType(0);
-  unsigned NumElts = VT.getVectorNumElements();
   unsigned NumBitsPerElt = VT.getScalarSizeInBits();
 
   // This fails for mask register (vXi1) shifts.
@@ -30511,7 +30510,8 @@ static SDValue combineVectorShift(SDNode
   SmallVector<APInt, 32> EltBits;
   if (N->isOnlyUserOf(N0.getNode()) &&
       getTargetConstantBitsFromNode(N0, NumBitsPerElt, UndefElts, EltBits)) {
-    assert(EltBits.size() == NumElts && "Unexpected shift value type");
+    assert(EltBits.size() == VT.getVectorNumElements() &&
+           "Unexpected shift value type");
     unsigned ShiftImm = ShiftVal.getZExtValue();
     for (APInt &Elt : EltBits) {
       if (X86ISD::VSHLI == Opcode)




More information about the llvm-commits mailing list