Refine fix to PR10499, no functionality change
[oota-llvm.git] / lib / Target / X86 / X86ISelLowering.cpp
index 57014dd488089126a86a05129d873ae15fd9499e..fb3352059a9cdd0a164c885e3cf9f4e618b30bdb 100644 (file)
@@ -5344,7 +5344,7 @@ X86TargetLowering::LowerBUILD_VECTOR(SDValue Op, SelectionDAG &DAG) const {
   // Vectors containing all ones can be matched by pcmpeqd on 128-bit width
   // vectors or broken into v4i32 operations on 256-bit vectors. AVX2 can use
   // vpcmpeqd on 256-bit vectors.
-  if (ISD::isBuildVectorAllOnes(Op.getNode()) && Subtarget->hasSSE2()) {
+  if (Subtarget->hasSSE2() && ISD::isBuildVectorAllOnes(Op.getNode())) {
     if (VT == MVT::v4i32 || (VT == MVT::v8i32 && Subtarget->hasInt256()))
       return Op;