aboutsummaryrefslogtreecommitdiff
path: root/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2005-04-18 04:11:19 +0000
committerChris Lattner <sabre@nondot.org>2005-04-18 04:11:19 +0000
commit7467c9b086d3917333ece77e9fc8624922d42ef1 (patch)
tree7244e68db1f3f6b3826551394d39b2defdfbbf37 /lib/CodeGen/SelectionDAG/SelectionDAG.cpp
parent706aa9685ad74e4825544064bf28aa5b42578812 (diff)
Another simple xform
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21317 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/SelectionDAG/SelectionDAG.cpp')
-rw-r--r--lib/CodeGen/SelectionDAG/SelectionDAG.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/CodeGen/SelectionDAG/SelectionDAG.cpp b/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
index 3058ceafe2..a52289fb38 100644
--- a/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
+++ b/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
@@ -964,6 +964,14 @@ SDOperand SelectionDAG::getNode(unsigned Opcode, MVT::ValueType VT,
return getSetCC(Result, LHS->getValueType(0), LL, LR);
}
}
+
+ // and/or zext(a), zext(b) -> zext(and/or a, b)
+ if (N1.getOpcode() == ISD::ZERO_EXTEND &&
+ N2.getOpcode() == ISD::ZERO_EXTEND &&
+ N1.getOperand(0).getValueType() == N2.getOperand(0).getValueType())
+ return getNode(ISD::ZERO_EXTEND, VT,
+ getNode(Opcode, N1.getOperand(0).getValueType(),
+ N1.getOperand(0), N2.getOperand(0)));
break;
case ISD::XOR:
if (N1 == N2) return getConstant(0, VT); // xor X, Y -> 0