[llvm-commits] CVS: llvm/utils/TableGen/DAGISelEmitter.cpp

Chris Lattner lattner at cs.uiuc.edu
Tue Aug 15 16:42:40 PDT 2006



Changes in directory llvm/utils/TableGen:

DAGISelEmitter.cpp updated: 1.243 -> 1.244
---
Log message:

The generated runloop shouldn't require Select to update 'Result'.  In fact
we'd like to remove result entirely.


---
Diffs of the changes:  (+6 -3)

 DAGISelEmitter.cpp |    9 ++++++---
 1 files changed, 6 insertions(+), 3 deletions(-)


Index: llvm/utils/TableGen/DAGISelEmitter.cpp
diff -u llvm/utils/TableGen/DAGISelEmitter.cpp:1.243 llvm/utils/TableGen/DAGISelEmitter.cpp:1.244
--- llvm/utils/TableGen/DAGISelEmitter.cpp:1.243	Tue Aug 15 18:27:50 2006
+++ llvm/utils/TableGen/DAGISelEmitter.cpp	Tue Aug 15 18:42:26 2006
@@ -3646,8 +3646,11 @@
   OS << "  memset(ISelQueued,   0, NumBytes);\n";
   OS << "  memset(ISelSelected, 0, NumBytes);\n";
   OS << "\n";
-  OS << "  SDOperand ResNode;\n";
-  OS << "  Select(ResNode, Root);\n";
+  OS << "  // Create a dummy node (which is not added to allnodes), that adds\n"
+     << "  // a reference to the root node, preventing it from being deleted,\n"
+     << "  // and tracking any changes of the root.\n"
+     << "  HandleSDNode Dummy(CurDAG->getRoot());\n"
+     << "  ISelQueue.push_back(CurDAG->getRoot().Val);\n";
   OS << "  while (!ISelQueue.empty()) {\n";
   OS << "    SDOperand Tmp;\n";
   OS << "    SDNode *Node = ISelQueue.front();\n";
@@ -3663,7 +3666,7 @@
   OS << "  ISelQueued = NULL;\n";
   OS << "  delete[] ISelSelected;\n";
   OS << "  ISelSelected = NULL;\n";
-  OS << "  return ResNode;\n";
+  OS << "  return Dummy.getValue();\n";
   OS << "}\n";
   
   Intrinsics = LoadIntrinsics(Records);






More information about the llvm-commits mailing list