[llvm] r327179 - [TargetLowering] Remove redundant term in two ifs in SimplifySetCC. NFC

Craig Topper via llvm-commits llvm-commits at lists.llvm.org
Fri Mar 9 14:24:12 PST 2018


Author: ctopper
Date: Fri Mar  9 14:24:12 2018
New Revision: 327179

URL: http://llvm.org/viewvc/llvm-project?rev=327179&view=rev
Log:
[TargetLowering] Remove redundant term in two ifs in SimplifySetCC. NFC

If we get into the right hand side of the OR, we know that isOpaque is true since the left hand size is just a check that it's false.

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=327179&r1=327178&r2=327179&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/SelectionDAG/TargetLowering.cpp (original)
+++ llvm/trunk/lib/CodeGen/SelectionDAG/TargetLowering.cpp Fri Mar  9 14:24:12 2018
@@ -2256,7 +2256,7 @@ SDValue TargetLowering::SimplifySetCC(EV
         ISD::CondCode NewCC = (Cond == ISD::SETGE) ? ISD::SETGT : ISD::SETUGT;
         if ((DCI.isBeforeLegalizeOps() ||
              isCondCodeLegal(NewCC, VT.getSimpleVT())) &&
-            (!N1C->isOpaque() || (N1C->isOpaque() && C.getBitWidth() <= 64 &&
+            (!N1C->isOpaque() || (C.getBitWidth() <= 64 &&
                                   isLegalICmpImmediate(C.getSExtValue())))) {
           return DAG.getSetCC(dl, VT, N0,
                               DAG.getConstant(C, dl, N1.getValueType()),
@@ -2276,7 +2276,7 @@ SDValue TargetLowering::SimplifySetCC(EV
         ISD::CondCode NewCC = (Cond == ISD::SETLE) ? ISD::SETLT : ISD::SETULT;
         if ((DCI.isBeforeLegalizeOps() ||
              isCondCodeLegal(NewCC, VT.getSimpleVT())) &&
-            (!N1C->isOpaque() || (N1C->isOpaque() && C.getBitWidth() <= 64 &&
+            (!N1C->isOpaque() || (C.getBitWidth() <= 64 &&
                                   isLegalICmpImmediate(C.getSExtValue())))) {
           return DAG.getSetCC(dl, VT, N0,
                               DAG.getConstant(C, dl, N1.getValueType()),




More information about the llvm-commits mailing list