aboutsummaryrefslogtreecommitdiff
path: root/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
diff options
context:
space:
mode:
authorEvan Cheng <evan.cheng@apple.com>2006-09-21 19:04:05 +0000
committerEvan Cheng <evan.cheng@apple.com>2006-09-21 19:04:05 +0000
commit2adffa1f6648c2bb1d96f22a4bf97964b7e4128f (patch)
treec13815b2ad51c753790148cdf4926e43cd24d584 /lib/CodeGen/SelectionDAG/DAGCombiner.cpp
parent649069728f49f041df68c54ead70687ecb946e89 (diff)
Make it work for DAG combine of multi-value nodes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30573 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/SelectionDAG/DAGCombiner.cpp')
-rw-r--r--lib/CodeGen/SelectionDAG/DAGCombiner.cpp9
1 files changed, 7 insertions, 2 deletions
diff --git a/lib/CodeGen/SelectionDAG/DAGCombiner.cpp b/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
index 3e53ae0ed3..c30a222b4a 100644
--- a/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
+++ b/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
@@ -407,8 +407,13 @@ void DAGCombiner::Run(bool RunningAfterLegalize) {
std::cerr << "\nWith: "; RV.Val->dump(&DAG);
std::cerr << '\n');
std::vector<SDNode*> NowDead;
- SDOperand OpV = RV;
- DAG.ReplaceAllUsesWith(N, &OpV, &NowDead);
+ if (N->getNumValues() == RV.Val->getNumValues())
+ DAG.ReplaceAllUsesWith(N, RV.Val, &NowDead);
+ else {
+ assert(N->getValueType(0) == RV.getValueType() && "Type mismatch");
+ SDOperand OpV = RV;
+ DAG.ReplaceAllUsesWith(N, &OpV, &NowDead);
+ }
// Push the new node and any users onto the worklist
WorkList.push_back(RV.Val);