[llvm] r318969 - [X86] Qualify some vector specific code with VT.isVector(). NFCI

Craig Topper via llvm-commits llvm-commits at lists.llvm.org
Fri Nov 24 23:20:23 PST 2017


Author: ctopper
Date: Fri Nov 24 23:20:23 2017
New Revision: 318969

URL: http://llvm.org/viewvc/llvm-project?rev=318969&view=rev
Log:
[X86] Qualify some vector specific code with VT.isVector(). NFCI

Other checks inside require a build_vector, but we this lets us stop earlier and makes the code more clear.

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=318969&r1=318968&r2=318969&view=diff
==============================================================================
--- llvm/trunk/lib/Target/X86/X86ISelLowering.cpp (original)
+++ llvm/trunk/lib/Target/X86/X86ISelLowering.cpp Fri Nov 24 23:20:23 2017
@@ -35902,11 +35902,11 @@ static SDValue combineSetCC(SDNode *N, S
       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) {




More information about the llvm-commits mailing list