summaryrefslogtreecommitdiffstats
path: root/llvm/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
commit868d47300900bdbcaa2e166b4e9c411ac48a436e (patch)
tree4af2e3109242c70627d279860435f7b91e495ebd /llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
parentbd22d83d15bcc4466133c39c6a42ed7d344eeb89 (diff)
downloadbcm5719-llvm-868d47300900bdbcaa2e166b4e9c411ac48a436e.tar.gz
bcm5719-llvm-868d47300900bdbcaa2e166b4e9c411ac48a436e.zip
Another simple xform
llvm-svn: 21317
Diffstat (limited to 'llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp')
-rw-r--r--llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp b/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
index 3058ceafe27..a52289fb387 100644
--- a/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
+++ b/llvm/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
OpenPOWER on IntegriCloud