aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2007-03-04 20:08:45 +0000
committerChris Lattner <sabre@nondot.org>2007-03-04 20:08:45 +0000
commitbcf24844508a6acdc6d3078cc4d24978fcd0cca5 (patch)
treecba8337cfe95bfd90d90500b990e5f47ac2a3868
parent91153686f04bafe3b10c99edb1735444953f7517 (diff)
downloadexternal_llvm-bcf24844508a6acdc6d3078cc4d24978fcd0cca5.zip
external_llvm-bcf24844508a6acdc6d3078cc4d24978fcd0cca5.tar.gz
external_llvm-bcf24844508a6acdc6d3078cc4d24978fcd0cca5.tar.bz2
generalize
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34910 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--lib/CodeGen/SelectionDAG/DAGCombiner.cpp14
1 files changed, 9 insertions, 5 deletions
diff --git a/lib/CodeGen/SelectionDAG/DAGCombiner.cpp b/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
index d48f419..9fdbe26 100644
--- a/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
+++ b/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
@@ -757,8 +757,10 @@ SDOperand DAGCombiner::visitADDC(SDNode *N) {
SDOperand(N, 1));
// canonicalize constant to RHS.
- if (N0C && !N1C)
- return DAG.getNode(ISD::ADDC, VT, N1, N0);
+ if (N0C && !N1C) {
+ SDOperand Ops[] = { N1, N0 };
+ return DAG.getNode(ISD::ADDC, N->getVTList(), Ops, 2);
+ }
// fold (add x, 0) -> x + no carry out
//if (N1C && N1C->isNullValue())
@@ -772,11 +774,13 @@ SDOperand DAGCombiner::visitADDE(SDNode *N) {
SDOperand N1 = N->getOperand(1);
ConstantSDNode *N0C = dyn_cast<ConstantSDNode>(N0);
ConstantSDNode *N1C = dyn_cast<ConstantSDNode>(N1);
- MVT::ValueType VT = N0.getValueType();
+ //MVT::ValueType VT = N0.getValueType();
// canonicalize constant to RHS
- if (N0C && !N1C)
- return DAG.getNode(ISD::ADDE, VT, N1, N0, N->getOperand(2));
+ if (N0C && !N1C) {
+ SDOperand Ops[] = { N1, N0, N->getOperand(2) };
+ return DAG.getNode(ISD::ADDE, N->getVTList(), Ops, 3);
+ }
// fold (add x, 0) -> x
//if (N1C && N1C->isNullValue())