diff options
author | Jeff Cohen <jeffc@jolt-lang.org> | 2005-07-27 05:53:44 +0000 |
---|---|---|
committer | Jeff Cohen <jeffc@jolt-lang.org> | 2005-07-27 05:53:44 +0000 |
commit | 9eb59ec548b861d6ede05b4e6dc22aabf645e665 (patch) | |
tree | 97ffa1993e23e29ccabac9646fc950717bd94dda /lib/Target/SparcV9/ModuloScheduling/MSSchedule.cpp | |
parent | 50e9ef8792c5c91b7ea6f24f878d1abbcb6024a4 (diff) |
Eliminate tabs and trailing spaces.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22520 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target/SparcV9/ModuloScheduling/MSSchedule.cpp')
-rw-r--r-- | lib/Target/SparcV9/ModuloScheduling/MSSchedule.cpp | 74 |
1 files changed, 37 insertions, 37 deletions
diff --git a/lib/Target/SparcV9/ModuloScheduling/MSSchedule.cpp b/lib/Target/SparcV9/ModuloScheduling/MSSchedule.cpp index 6e8a6db347..3513d5c9d3 100644 --- a/lib/Target/SparcV9/ModuloScheduling/MSSchedule.cpp +++ b/lib/Target/SparcV9/ModuloScheduling/MSSchedule.cpp @@ -33,10 +33,10 @@ bool MSSchedule::insert(MSchedGraphNode *node, int cycle, int II) { if (schedule[cycle].size() < numIssue) { //Now check if all the resources in their respective cycles are available if(resourcesFree(node, cycle, II)) { - //Insert to preserve dependencies - addToSchedule(cycle,node); - DEBUG(std::cerr << "Found spot in map, and there is an issue slot\n"); - return false; + //Insert to preserve dependencies + addToSchedule(cycle,node); + DEBUG(std::cerr << "Found spot in map, and there is an issue slot\n"); + return false; } } } @@ -81,7 +81,7 @@ bool MSSchedule::resourceAvailable(int resourceNum, int cycle) { if(resourceNumPerCycle[cycle].count(resourceNum)) { int maxRes = CPUResource::getCPUResource(resourceNum)->maxNumUsers; if(resourceNumPerCycle[cycle][resourceNum] >= maxRes) - isFree = false; + isFree = false; } } @@ -137,21 +137,21 @@ bool MSSchedule::resourcesFree(MSchedGraphNode *node, int cycle, int II) { //Loop over resources in each cycle and increments their usage count for(unsigned i=0; i < resources.size(); ++i) { for(unsigned j=0; j < resources[i].size(); ++j) { - - //Get Resource to check its availability - int resourceNum = resources[i][j]; - - DEBUG(std::cerr << "Attempting to schedule Resource Num: " << resourceNum << " in cycle: " << currentCycle << "\n"); - - success = resourceAvailable(resourceNum, currentCycle); - - if(!success) - break; - + + //Get Resource to check its availability + int resourceNum = resources[i][j]; + + DEBUG(std::cerr << "Attempting to schedule Resource Num: " << resourceNum << " in cycle: " << currentCycle << "\n"); + + success = resourceAvailable(resourceNum, currentCycle); + + if(!success) + break; + } if(!success) - break; + break; //Increase cycle currentCycle++; @@ -172,8 +172,8 @@ bool MSSchedule::resourcesFree(MSchedGraphNode *node, int cycle, int II) { //Loop over resources in each cycle and increments their usage count for(unsigned i=0; i < resources.size(); ++i) { for(unsigned j=0; j < resources[i].size(); ++j) { - int resourceNum = resources[i][j]; - useResource(resourceNum, currentCycle); + int resourceNum = resources[i][j]; + useResource(resourceNum, currentCycle); } currentCycle++; } @@ -205,15 +205,15 @@ bool MSSchedule::constructKernel(int II, std::vector<MSchedGraphNode*> &branches int count = 0; for(int i = index; i <= (schedule.rbegin()->first); i+=II) { if(schedule.count(i)) { - for(std::vector<MSchedGraphNode*>::iterator I = schedule[i].begin(), - E = schedule[i].end(); I != E; ++I) { - //Check if its a branch - assert(!(*I)->isBranch() && "Branch should not be schedule!"); - - tempKernel.push_back(std::make_pair(*I, count)); - maxSN = std::max(maxSN, count); - - } + for(std::vector<MSchedGraphNode*>::iterator I = schedule[i].begin(), + E = schedule[i].end(); I != E; ++I) { + //Check if its a branch + assert(!(*I)->isBranch() && "Branch should not be schedule!"); + + tempKernel.push_back(std::make_pair(*I, count)); + maxSN = std::max(maxSN, count); + + } } ++count; } @@ -231,14 +231,14 @@ bool MSSchedule::constructKernel(int II, std::vector<MSchedGraphNode*> &branches for(std::map<const MachineInstr*, unsigned>::iterator N = indVar.begin(), NE = indVar.end(); N != NE; ++N) { - if(N->second < I->first->getIndex()) - tmpMap[N->second] = (MachineInstr*) N->first; + if(N->second < I->first->getIndex()) + tmpMap[N->second] = (MachineInstr*) N->first; } //Add to kernel, and delete from indVar for(std::map<unsigned, MachineInstr*>::iterator N = tmpMap.begin(), NE = tmpMap.end(); N != NE; ++N) { - kernel.push_back(std::make_pair(N->second, 0)); - indVar.erase(N->second); + kernel.push_back(std::make_pair(N->second, 0)); + indVar.erase(N->second); } } @@ -278,10 +278,10 @@ bool MSSchedule::defPreviousStage(Value *def, int stage) { const MachineOperand &mOp = inst->getOperand(i); if(mOp.getType() == MachineOperand::MO_VirtualRegister && mOp.isDef()) { if(def == mOp.getVRegValue()) { - if(P->second >= stage) - return false; - else - return true; + if(P->second >= stage) + return false; + else + return true; } } } @@ -302,7 +302,7 @@ void MSSchedule::print(std::ostream &os) const { os << "Kernel:\n"; for(std::vector<std::pair<MachineInstr*, int> >::const_iterator I = kernel.begin(), - E = kernel.end(); I != E; ++I) + E = kernel.end(); I != E; ++I) os << "Node: " << *(I->first) << " Stage: " << I->second << "\n"; } |