Fix -Wunused-variable warning in non-asserts build, and optimize a little bit while...
authorDavid Blaikie <dblaikie@gmail.com>
Fri, 20 Feb 2015 06:28:38 +0000 (06:28 +0000)
committerDavid Blaikie <dblaikie@gmail.com>
Fri, 20 Feb 2015 06:28:38 +0000 (06:28 +0000)
llvm-svn: 229970

llvm/lib/Target/X86/X86ISelLowering.cpp

index 90718e9..ab02f14 100644 (file)
@@ -8243,14 +8243,14 @@ static SDValue lowerV8I16VectorShuffle(SDValue Op, SDValue V1, SDValue V2,
   auto isV1 = [](int M) { return M >= 0 && M < 8; };
   auto isV2 = [](int M) { return M >= 8; };
 
-  int NumV1Inputs = std::count_if(Mask.begin(), Mask.end(), isV1);
   int NumV2Inputs = std::count_if(Mask.begin(), Mask.end(), isV2);
 
   if (NumV2Inputs == 0)
     return lowerV8I16SingleInputVectorShuffle(DL, V1, Mask, Subtarget, DAG);
 
-  assert(NumV1Inputs > 0 && "All single-input shuffles should be canonicalized "
-                            "to be V1-input shuffles.");
+  assert(std::any_of(Mask.begin(), Mask.end(), isV1) &&
+         "All single-input shuffles should be canonicalized to be V1-input "
+         "shuffles.");
 
   // Try to use shift instructions.
   if (SDValue Shift =