[X86] Qualify some vector specific code with VT.isVector(). NFCI
authorCraig Topper <craig.topper@intel.com>
Sat, 25 Nov 2017 07:20:23 +0000 (07:20 +0000)
committerCraig Topper <craig.topper@intel.com>
Sat, 25 Nov 2017 07:20:23 +0000 (07:20 +0000)
Other checks inside require a build_vector, but we this lets us stop earlier and makes the code more clear.

llvm-svn: 318969

llvm/lib/Target/X86/X86ISelLowering.cpp

index 4db9fe8..1673ce5 100644 (file)
@@ -35902,11 +35902,11 @@ static SDValue combineSetCC(SDNode *N, SelectionDAG &DAG,
       return V;
   }
 
-  if (VT.getScalarType() == MVT::i1 &&
+  if (VT.isVector() && VT.getVectorElementType() == MVT::i1 &&
       (CC == ISD::SETNE || CC == ISD::SETEQ || ISD::isSignedIntSetCC(CC))) {
     bool IsSEXT0 =
         (LHS.getOpcode() == ISD::SIGN_EXTEND) &&
-        (LHS.getOperand(0).getValueType().getScalarType() == MVT::i1);
+        (LHS.getOperand(0).getValueType().getVectorElementType() == MVT::i1);
     bool IsVZero1 = ISD::isBuildVectorAllZeros(RHS.getNode());
 
     if (!IsSEXT0 || !IsVZero1) {