Fold (X > -1) | (Y > -1) --> (X&Y > -1)
authorChris Lattner <sabre@nondot.org>
Tue, 26 Apr 2005 01:18:33 +0000 (01:18 +0000)
committerChris Lattner <sabre@nondot.org>
Tue, 26 Apr 2005 01:18:33 +0000 (01:18 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21552 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/SelectionDAG/SelectionDAG.cpp

index 3e5395bd341f8d46173cc05e5b585524fe4b87da..e56ffec44f6fe99ac72e50d7e0f6b5a07fc37519 100644 (file)
@@ -1075,8 +1075,10 @@ SDOperand SelectionDAG::getNode(unsigned Opcode, MVT::ValueType VT,
           if (cast<ConstantSDNode>(LR)->isAllOnesValue()) {
             // (X == -1) & (Y == -1) -> (X&Y == -1)
             // (X != -1) | (Y != -1) -> (X&Y != -1)
+            // (X >  -1) | (Y >  -1) -> (X&Y >  -1)
             if ((Opcode == ISD::AND && Op2 == ISD::SETEQ) ||
-                (Opcode == ISD::OR  && Op2 == ISD::SETNE))
+                (Opcode == ISD::OR  && Op2 == ISD::SETNE) ||
+                (Opcode == ISD::OR  && Op2 == ISD::SETGT))
               return getSetCC(Op2, VT,
                             getNode(ISD::AND, LR.getValueType(), LL, RL), LR);
             // (X >  -1) & (Y >  -1) -> (X|Y > -1)