summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2005-04-26 01:18:33 +0000
committerChris Lattner <sabre@nondot.org>2005-04-26 01:18:33 +0000
commitcfa7ddd6e2e7f114f7f321cbb6423c3a05aec0f6 (patch)
tree4fe3ad9eebbb488c11d6a16ee8a3804a245fd754 /llvm/lib/CodeGen
parentfe91dfec918850fa71c7813229ec780d7f147dca (diff)
downloadbcm5719-llvm-cfa7ddd6e2e7f114f7f321cbb6423c3a05aec0f6.tar.gz
bcm5719-llvm-cfa7ddd6e2e7f114f7f321cbb6423c3a05aec0f6.zip
Fold (X > -1) | (Y > -1) --> (X&Y > -1)
llvm-svn: 21552
Diffstat (limited to 'llvm/lib/CodeGen')
-rw-r--r--llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp b/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
index 3e5395bd341..e56ffec44f6 100644
--- a/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
+++ b/llvm/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)
OpenPOWER on IntegriCloud