From 2adffa1f6648c2bb1d96f22a4bf97964b7e4128f Mon Sep 17 00:00:00 2001 From: Evan Cheng Date: Thu, 21 Sep 2006 19:04:05 +0000 Subject: [PATCH] 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 --- lib/CodeGen/SelectionDAG/DAGCombiner.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/lib/CodeGen/SelectionDAG/DAGCombiner.cpp b/lib/CodeGen/SelectionDAG/DAGCombiner.cpp index 3e53ae0ed3f..c30a222b4ac 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 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); -- 2.34.1