[llvm-commits] CVS: llvm/lib/Target/SparcV9/ModuloScheduling/MSchedGraph.cpp ModuloScheduling.cpp

Tanya Brethour tbrethou at cs.uiuc.edu
Tue Feb 15 20:01:15 PST 2005



Changes in directory llvm/lib/Target/SparcV9/ModuloScheduling:

MSchedGraph.cpp updated: 1.12 -> 1.13
ModuloScheduling.cpp updated: 1.41 -> 1.42
---
Log message:

Fixed node deletion bug.


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

 MSchedGraph.cpp      |    9 +++++----
 ModuloScheduling.cpp |   10 ++++++++--
 2 files changed, 13 insertions(+), 6 deletions(-)


Index: llvm/lib/Target/SparcV9/ModuloScheduling/MSchedGraph.cpp
diff -u llvm/lib/Target/SparcV9/ModuloScheduling/MSchedGraph.cpp:1.12 llvm/lib/Target/SparcV9/ModuloScheduling/MSchedGraph.cpp:1.13
--- llvm/lib/Target/SparcV9/ModuloScheduling/MSchedGraph.cpp:1.12	Thu Feb 10 11:02:58 2005
+++ llvm/lib/Target/SparcV9/ModuloScheduling/MSchedGraph.cpp	Tue Feb 15 22:00:59 2005
@@ -112,11 +112,12 @@
 void MSchedGraph::deleteNode(MSchedGraphNode *node) {
   
   //Delete the edge to this node from all predecessors
-  for(MSchedGraphNode::pred_iterator P = node->pred_begin(), PE = node->pred_end();
-      P != PE; ++P) {
-    (*P)->deleteSuccessor(node);
+  while(node->pred_size() > 0) {
+    //DEBUG(std::cerr << "Delete edge from: " << **P << " to " << *node << "\n"); 
+    MSchedGraphNode *pred = *(node->pred_begin());
+    pred->deleteSuccessor(node);
   }
-
+ 
   //Remove this node from the graph
   GraphMap.erase(node->getInst());
 


Index: llvm/lib/Target/SparcV9/ModuloScheduling/ModuloScheduling.cpp
diff -u llvm/lib/Target/SparcV9/ModuloScheduling/ModuloScheduling.cpp:1.41 llvm/lib/Target/SparcV9/ModuloScheduling/ModuloScheduling.cpp:1.42
--- llvm/lib/Target/SparcV9/ModuloScheduling/ModuloScheduling.cpp:1.41	Thu Feb 10 11:02:58 2005
+++ llvm/lib/Target/SparcV9/ModuloScheduling/ModuloScheduling.cpp	Tue Feb 15 22:00:59 2005
@@ -77,6 +77,8 @@
   Statistic<> MSLoops("modulosched-schedLoops", "Number of loops successfully modulo-scheduled");
   Statistic<> IncreasedII("modulosched-increasedII", "Number of times we had to increase II");
   Statistic<> SingleBBLoops("modulosched-singeBBLoops", "Number of single basic block loops");
+  Statistic<> NoSched("modulosched-noSched", "No schedule");
+  Statistic<> SameStage("modulosched-sameStage", "Max stage is 0");
 
   template<>
   struct DOTGraphTraits<MSchedGraph*> : public DefaultDOTGraphTraits {
@@ -252,9 +254,13 @@
       ++MSLoops;
       Changed = true;
     }
-    else
+    else {
+      if(!haveSched)
+	++NoSched;
+      else
+	++SameStage;
       DEBUG(std::cerr << "Max stage is 0, so no change in loop or reached cap\n");
-    
+    }
     //Clear out our maps for the next basic block that is processed
     nodeToAttributesMap.clear();
     partialOrder.clear();






More information about the llvm-commits mailing list