summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
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
commit2dcc6e7f58eecdfdd465480307858b57db739608 (patch)
treec19ab824ef1a59e78988b326b9dbbf836f03a59a /llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
parente2e13caeb2fa68330258e71594d3efddb5f49fc7 (diff)
downloadbcm5719-llvm-2dcc6e7f58eecdfdd465480307858b57db739608.tar.gz
bcm5719-llvm-2dcc6e7f58eecdfdd465480307858b57db739608.zip
generalize
llvm-svn: 34910
Diffstat (limited to 'llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp')
-rw-r--r--llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp14
1 files changed, 9 insertions, 5 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp b/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
index d48f4190340..9fdbe266ec2 100644
--- a/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
+++ b/llvm/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())
OpenPOWER on IntegriCloud