[llvm] r327069 - [TargetLowering] Remove redundant if condition in SimplifySetcc. NFC
Craig Topper via llvm-commits
llvm-commits at lists.llvm.org
Thu Mar 8 13:53:36 PST 2018
Author: ctopper
Date: Thu Mar 8 13:53:36 2018
New Revision: 327069
URL: http://llvm.org/viewvc/llvm-project?rev=327069&view=rev
Log:
[TargetLowering] Remove redundant if condition in SimplifySetcc. NFC
We were checking the condition code a second time when we were already in a block with this same condition code check.
Modified:
llvm/trunk/lib/CodeGen/SelectionDAG/TargetLowering.cpp
Modified: llvm/trunk/lib/CodeGen/SelectionDAG/TargetLowering.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/TargetLowering.cpp?rev=327069&r1=327068&r2=327069&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/SelectionDAG/TargetLowering.cpp (original)
+++ llvm/trunk/lib/CodeGen/SelectionDAG/TargetLowering.cpp Thu Mar 8 13:53:36 2018
@@ -2314,7 +2314,7 @@ SDValue TargetLowering::SimplifySetCC(EV
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);
More information about the llvm-commits
mailing list