Use vectors instead of hash_maps for issueGaps and conflictLists.

These hash lookups were a major sink of time because they happen so often!
Also, add option to disable scheduling.

llvm-svn: 4138
This commit is contained in:
Vikram S. Adve 2002-10-13 00:40:37 +00:00
parent f8c6e3db55
commit 9e5eb46362
1 changed files with 9 additions and 15 deletions

View File

@ -25,7 +25,6 @@ SDL_opt("dsched", cl::Hidden, cl::location(SchedDebugLevel),
cl::desc("enable instruction scheduling debugging information"), cl::desc("enable instruction scheduling debugging information"),
cl::values( cl::values(
clEnumValN(Sched_NoDebugInfo, "n", "disable debug output"), clEnumValN(Sched_NoDebugInfo, "n", "disable debug output"),
clEnumValN(Sched_Disable, "off", "disable instruction scheduling"),
clEnumValN(Sched_PrintMachineCode, "y", "print machine code after scheduling"), clEnumValN(Sched_PrintMachineCode, "y", "print machine code after scheduling"),
clEnumValN(Sched_PrintSchedTrace, "t", "print trace of scheduling actions"), clEnumValN(Sched_PrintSchedTrace, "t", "print trace of scheduling actions"),
clEnumValN(Sched_PrintSchedGraphs, "g", "print scheduling graphs"), clEnumValN(Sched_PrintSchedGraphs, "g", "print scheduling graphs"),
@ -549,19 +548,17 @@ SchedulingManager::updateEarliestStartTimes(const SchedGraphNode* node,
curTime + 1 + schedInfo.numBubblesAfter(node->getOpCode())); curTime + 1 + schedInfo.numBubblesAfter(node->getOpCode()));
} }
const vector<MachineOpCode>* const std::vector<MachineOpCode>&
conflictVec = schedInfo.getConflictList(node->getOpCode()); conflictVec = schedInfo.getConflictList(node->getOpCode());
if (conflictVec != NULL) for (unsigned i=0; i < conflictVec.size(); i++)
for (unsigned i=0; i < conflictVec->size(); i++) {
{ MachineOpCode toOp = conflictVec[i];
MachineOpCode toOp = (*conflictVec)[i]; cycles_t est=schedTime + schedInfo.getMinIssueGap(node->getOpCode(),toOp);
cycles_t est = schedTime + schedInfo.getMinIssueGap(node->getOpCode(), assert(toOp < (int) nextEarliestStartTime.size());
toOp); if (nextEarliestStartTime[toOp] < est)
assert(toOp < (int) nextEarliestStartTime.size()); nextEarliestStartTime[toOp] = est;
if (nextEarliestStartTime[toOp] < est) }
nextEarliestStartTime[toOp] = est;
}
} }
//************************* Internal Functions *****************************/ //************************* Internal Functions *****************************/
@ -1511,9 +1508,6 @@ namespace {
bool InstructionSchedulingWithSSA::runOnFunction(Function &F) bool InstructionSchedulingWithSSA::runOnFunction(Function &F)
{ {
if (SchedDebugLevel == Sched_Disable)
return false;
SchedGraphSet graphSet(&F, target); SchedGraphSet graphSet(&F, target);
if (SchedDebugLevel >= Sched_PrintSchedGraphs) if (SchedDebugLevel >= Sched_PrintSchedGraphs)