diff options
author | Tanya Lattner <tonic@nondot.org> | 2005-02-23 02:01:42 +0000 |
---|---|---|
committer | Tanya Lattner <tonic@nondot.org> | 2005-02-23 02:01:42 +0000 |
commit | 01b4abd3487b313482ebbce42398ef0d129b2737 (patch) | |
tree | 597943b0b5bc34da780540f0758b8b76dc7e7694 /lib/Target/SparcV9/ModuloScheduling/MSSchedule.cpp | |
parent | 6c2997f5b90449b00387d0635ce9acf0874b8383 (diff) |
Fixed bug in findAllcircuits. Fixed branch addition to schedule. Added debug information.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20280 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target/SparcV9/ModuloScheduling/MSSchedule.cpp')
-rw-r--r-- | lib/Target/SparcV9/ModuloScheduling/MSSchedule.cpp | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/lib/Target/SparcV9/ModuloScheduling/MSSchedule.cpp b/lib/Target/SparcV9/ModuloScheduling/MSSchedule.cpp index beab69c4db..96662dd887 100644 --- a/lib/Target/SparcV9/ModuloScheduling/MSSchedule.cpp +++ b/lib/Target/SparcV9/ModuloScheduling/MSSchedule.cpp @@ -19,6 +19,7 @@ using namespace llvm; +//Returns a boolean indicating if the start cycle needs to be increased/decreased bool MSSchedule::insert(MSchedGraphNode *node, int cycle) { //First, check if the cycle has a spot free to start @@ -147,6 +148,7 @@ bool MSSchedule::resourcesFree(MSchedGraphNode *node, int cycle) { 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!"); + DEBUG(std::cerr << "Removing resource num " << resourceNum << " from cycle " << oldCycle << "\n"); --resourceUse->second; } } @@ -163,7 +165,7 @@ bool MSSchedule::resourcesFree(MSchedGraphNode *node, int cycle) { } -bool MSSchedule::constructKernel(int II) { +bool MSSchedule::constructKernel(int II, std::vector<MSchedGraphNode*> &branches) { int stageNum = (schedule.rbegin()->first)/ II; DEBUG(std::cerr << "Number of Stages: " << stageNum << "\n"); @@ -188,6 +190,11 @@ bool MSSchedule::constructKernel(int II) { } } + //Push on branches. Branch vector is in order of last branch to first. + for(std::vector<MSchedGraphNode*>::reverse_iterator B = branches.rbegin() , BE = branches.rend(); B != BE; ++B) { + kernel.push_back(std::make_pair(*B, 0)); + } + if(stageNum > 0) maxStage = stageNum; else |