[TargetLowering] Remove redundant if condition in SimplifySetcc. NFC
authorCraig Topper <craig.topper@intel.com>
Thu, 8 Mar 2018 21:53:36 +0000 (21:53 +0000)
committerCraig Topper <craig.topper@intel.com>
Thu, 8 Mar 2018 21:53:36 +0000 (21:53 +0000)
We were checking the condition code a second time when we were already in a block with this same condition code check.

llvm-svn: 327069

llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp

index fe24d4d..02b1818 100644 (file)
@@ -2314,7 +2314,7 @@ SDValue TargetLowering::SimplifySetCC(EVT VT, SDValue N0, SDValue N1,
           return DAG.getSetCC(dl, VT, N0, N1, ISD::SETNE);
 
         // If we have setugt X, Max-1, turn it into seteq X, Max
-        if ((Cond == ISD::SETGT || Cond == ISD::SETUGT) && C1 == MaxVal-1)
+        if (C1 == MaxVal-1)
           return DAG.getSetCC(dl, VT, N0,
                               DAG.getConstant(MaxVal, dl, N0.getValueType()),
                               ISD::SETEQ);