diff options
author | Tanya Lattner <tonic@nondot.org> | 2004-10-30 00:39:07 +0000 |
---|---|---|
committer | Tanya Lattner <tonic@nondot.org> | 2004-10-30 00:39:07 +0000 |
commit | 260652a7af1c1dc910675bc58cbf342dbcf3a9a6 (patch) | |
tree | 06bf885a350867cee14f6565c8aeba826a115f0d /lib/Target/SparcV9/ModuloScheduling/MSSchedule.cpp | |
parent | b1883932c7be741160221741828901528f16e525 (diff) |
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.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17351 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target/SparcV9/ModuloScheduling/MSSchedule.cpp')
-rw-r--r-- | lib/Target/SparcV9/ModuloScheduling/MSSchedule.cpp | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/lib/Target/SparcV9/ModuloScheduling/MSSchedule.cpp b/lib/Target/SparcV9/ModuloScheduling/MSSchedule.cpp index f4a6924d6b..02cd8b7841 100644 --- a/lib/Target/SparcV9/ModuloScheduling/MSSchedule.cpp +++ b/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<int, std::map<int,int> >::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<int, std::map<int,int> >::iterator resourcesForCycle = resourceNumPerCycle.find(oldCycle); - - for(unsigned j=0; j < resources[i].size(); ++j) { - int resourceNum = resources[i][j]; - //remove from map - std::map<int, int>::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<int, int>::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 |