From ddebd1eeaaa78cf6f6c3b7d2ac550922ba84db71 Mon Sep 17 00:00:00 2001 From: Tanya Lattner Date: Sat, 30 Oct 2004 00:39:07 +0000 Subject: Fixed bug with infinite epilogues. Fixed issue with generating the partial order. It now adds the nodes not in recurrences in sets for each connected component. llvm-svn: 17351 --- .../Target/SparcV9/ModuloScheduling/MSSchedule.cpp | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) (limited to 'llvm/lib/Target/SparcV9/ModuloScheduling/MSSchedule.cpp') diff --git a/llvm/lib/Target/SparcV9/ModuloScheduling/MSSchedule.cpp b/llvm/lib/Target/SparcV9/ModuloScheduling/MSSchedule.cpp index f4a6924d6b1..02cd8b7841b 100644 --- a/llvm/lib/Target/SparcV9/ModuloScheduling/MSSchedule.cpp +++ b/llvm/lib/Target/SparcV9/ModuloScheduling/MSSchedule.cpp @@ -63,6 +63,8 @@ bool MSSchedule::resourcesFree(MSchedGraphNode *node, int cycle) { for(unsigned j=0; j < resources[i].size(); ++j) { int resourceNum = resources[i][j]; + DEBUG(std::cerr << "Attempting to schedule Resource Num: " << resourceNum << " in cycle: " << currentCycle << "\n"); + //Check if this resource is available for this cycle std::map >::iterator resourcesForCycle = resourceNumPerCycle.find(currentCycle); @@ -111,14 +113,15 @@ bool MSSchedule::resourcesFree(MSchedGraphNode *node, int cycle) { //Check if this resource is available for this cycle std::map >::iterator resourcesForCycle = resourceNumPerCycle.find(oldCycle); - - for(unsigned j=0; j < resources[i].size(); ++j) { - int resourceNum = resources[i][j]; - //remove from map - std::map::iterator resourceUse = resourcesForCycle->second.find(resourceNum); - //assert if not in the map.. since it should be! - //assert(resourceUse != resourcesForCycle.end() && "Resource should be in map!"); - --resourceUse->second; + if(resourcesForCycle != resourceNumPerCycle.end()) { + for(unsigned j=0; j < resources[i].size(); ++j) { + int resourceNum = resources[i][j]; + //remove from map + std::map::iterator resourceUse = resourcesForCycle->second.find(resourceNum); + //assert if not in the map.. since it should be! + //assert(resourceUse != resourcesForCycle.end() && "Resource should be in map!"); + --resourceUse->second; + } } } else -- cgit v1.2.3