diff options
author | Chris Lattner <sabre@nondot.org> | 2005-04-26 01:18:33 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2005-04-26 01:18:33 +0000 |
commit | d36f979085048f0d24dbe4a5584acd89153940a8 (patch) | |
tree | dfe1007d2d928ff0ab5d50bb687c30361c32aca8 /lib/CodeGen/SelectionDAG/SelectionDAG.cpp | |
parent | 855adb1ac449d6a8c5d686a21953e0a4f6279ddc (diff) |
Fold (X > -1) | (Y > -1) --> (X&Y > -1)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21552 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/SelectionDAG/SelectionDAG.cpp')
-rw-r--r-- | lib/CodeGen/SelectionDAG/SelectionDAG.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/CodeGen/SelectionDAG/SelectionDAG.cpp b/lib/CodeGen/SelectionDAG/SelectionDAG.cpp index 3e5395bd34..e56ffec44f 100644 --- a/lib/CodeGen/SelectionDAG/SelectionDAG.cpp +++ b/lib/CodeGen/SelectionDAG/SelectionDAG.cpp @@ -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) |