Make it work for DAG combine of multi-value nodes.

llvm-svn: 30573
This commit is contained in:
Evan Cheng 2006-09-21 19:04:05 +00:00
parent 99ae714459
commit 449a0c7e33
1 changed files with 7 additions and 2 deletions

View File

@ -407,8 +407,13 @@ void DAGCombiner::Run(bool RunningAfterLegalize) {
std::cerr << "\nWith: "; RV.Val->dump(&DAG);
std::cerr << '\n');
std::vector<SDNode*> 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);