diff options
author | Dan Gohman <gohman@apple.com> | 2008-06-02 22:27:05 +0000 |
---|---|---|
committer | Dan Gohman <gohman@apple.com> | 2008-06-02 22:27:05 +0000 |
commit | 057240f4f0b3708612458e58f6cfc7421b3b450c (patch) | |
tree | dd852f46b9bd8f8f96ff2302677a2d08125a8053 /llvm/lib/CodeGen/SelectionDAG | |
parent | 5793cbcf44d53034ffad401c373cc3bb5ee980d4 (diff) | |
download | bcm5719-llvm-057240f4f0b3708612458e58f6cfc7421b3b450c.tar.gz bcm5719-llvm-057240f4f0b3708612458e58f6cfc7421b3b450c.zip |
Fold adds and subtracts of zero immediately, instead of waiting
for dagcombine to do this.
llvm-svn: 51886
Diffstat (limited to 'llvm/lib/CodeGen/SelectionDAG')
-rw-r--r-- | llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp b/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp index c8f5d534e48..a9b7381a096 100644 --- a/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp +++ b/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp @@ -2115,10 +2115,12 @@ SDOperand SelectionDAG::getNode(unsigned Opcode, MVT::ValueType VT, break; case ISD::OR: case ISD::XOR: + case ISD::ADD: + case ISD::SUB: assert(MVT::isInteger(VT) && N1.getValueType() == N2.getValueType() && N1.getValueType() == VT && "Binary operator types must match!"); - // (X ^| 0) -> X. This commonly occurs when legalizing i64 values, so it's - // worth handling here. + // (X ^|+- 0) -> X. This commonly occurs when legalizing i64 values, so + // it's worth handling here. if (N2C && N2C->isNullValue()) return N1; break; @@ -2128,8 +2130,6 @@ SDOperand SelectionDAG::getNode(unsigned Opcode, MVT::ValueType VT, case ISD::MULHS: assert(MVT::isInteger(VT) && "This operator does not apply to FP types!"); // fall through - case ISD::ADD: - case ISD::SUB: case ISD::MUL: case ISD::SDIV: case ISD::SREM: |