[llvm-commits] CVS: llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
Evan Cheng
evan.cheng at apple.com
Thu Sep 21 12:04:20 PDT 2006
Changes in directory llvm/lib/CodeGen/SelectionDAG:
DAGCombiner.cpp updated: 1.196 -> 1.197
---
Log message:
Make it work for DAG combine of multi-value nodes.
---
Diffs of the changes: (+7 -2)
DAGCombiner.cpp | 9 +++++++--
1 files changed, 7 insertions(+), 2 deletions(-)
Index: llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
diff -u llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp:1.196 llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp:1.197
--- llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp:1.196 Thu Sep 21 12:35:47 2006
+++ llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp Thu Sep 21 14:04:05 2006
@@ -407,8 +407,13 @@
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);
More information about the llvm-commits
mailing list