From 1632e882f1a4a0a18be5821020a1bd2029656d80 Mon Sep 17 00:00:00 2001 From: "Vikram S. Adve" Date: Sun, 13 Oct 2002 00:40:37 +0000 Subject: [PATCH] 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4138 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/CodeGen/InstrSched/InstrScheduling.cpp | 24 +++++++------------ .../SparcV9/InstrSched/InstrScheduling.cpp | 24 +++++++------------ 2 files changed, 18 insertions(+), 30 deletions(-) diff --git a/lib/CodeGen/InstrSched/InstrScheduling.cpp b/lib/CodeGen/InstrSched/InstrScheduling.cpp index 97360c3dd08..a985680da3d 100644 --- a/lib/CodeGen/InstrSched/InstrScheduling.cpp +++ b/lib/CodeGen/InstrSched/InstrScheduling.cpp @@ -25,7 +25,6 @@ SDL_opt("dsched", cl::Hidden, cl::location(SchedDebugLevel), cl::desc("enable instruction scheduling debugging information"), cl::values( 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_PrintSchedTrace, "t", "print trace of scheduling actions"), clEnumValN(Sched_PrintSchedGraphs, "g", "print scheduling graphs"), @@ -549,19 +548,17 @@ SchedulingManager::updateEarliestStartTimes(const SchedGraphNode* node, curTime + 1 + schedInfo.numBubblesAfter(node->getOpCode())); } - const vector* + const std::vector& conflictVec = schedInfo.getConflictList(node->getOpCode()); - if (conflictVec != NULL) - for (unsigned i=0; i < conflictVec->size(); i++) - { - MachineOpCode toOp = (*conflictVec)[i]; - cycles_t est = schedTime + schedInfo.getMinIssueGap(node->getOpCode(), - toOp); - assert(toOp < (int) nextEarliestStartTime.size()); - if (nextEarliestStartTime[toOp] < est) - nextEarliestStartTime[toOp] = est; - } + for (unsigned i=0; i < conflictVec.size(); i++) + { + MachineOpCode toOp = conflictVec[i]; + cycles_t est=schedTime + schedInfo.getMinIssueGap(node->getOpCode(),toOp); + assert(toOp < (int) nextEarliestStartTime.size()); + if (nextEarliestStartTime[toOp] < est) + nextEarliestStartTime[toOp] = est; + } } //************************* Internal Functions *****************************/ @@ -1511,9 +1508,6 @@ namespace { bool InstructionSchedulingWithSSA::runOnFunction(Function &F) { - if (SchedDebugLevel == Sched_Disable) - return false; - SchedGraphSet graphSet(&F, target); if (SchedDebugLevel >= Sched_PrintSchedGraphs) diff --git a/lib/Target/SparcV9/InstrSched/InstrScheduling.cpp b/lib/Target/SparcV9/InstrSched/InstrScheduling.cpp index 97360c3dd08..a985680da3d 100644 --- a/lib/Target/SparcV9/InstrSched/InstrScheduling.cpp +++ b/lib/Target/SparcV9/InstrSched/InstrScheduling.cpp @@ -25,7 +25,6 @@ SDL_opt("dsched", cl::Hidden, cl::location(SchedDebugLevel), cl::desc("enable instruction scheduling debugging information"), cl::values( 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_PrintSchedTrace, "t", "print trace of scheduling actions"), clEnumValN(Sched_PrintSchedGraphs, "g", "print scheduling graphs"), @@ -549,19 +548,17 @@ SchedulingManager::updateEarliestStartTimes(const SchedGraphNode* node, curTime + 1 + schedInfo.numBubblesAfter(node->getOpCode())); } - const vector* + const std::vector& conflictVec = schedInfo.getConflictList(node->getOpCode()); - if (conflictVec != NULL) - for (unsigned i=0; i < conflictVec->size(); i++) - { - MachineOpCode toOp = (*conflictVec)[i]; - cycles_t est = schedTime + schedInfo.getMinIssueGap(node->getOpCode(), - toOp); - assert(toOp < (int) nextEarliestStartTime.size()); - if (nextEarliestStartTime[toOp] < est) - nextEarliestStartTime[toOp] = est; - } + for (unsigned i=0; i < conflictVec.size(); i++) + { + MachineOpCode toOp = conflictVec[i]; + cycles_t est=schedTime + schedInfo.getMinIssueGap(node->getOpCode(),toOp); + assert(toOp < (int) nextEarliestStartTime.size()); + if (nextEarliestStartTime[toOp] < est) + nextEarliestStartTime[toOp] = est; + } } //************************* Internal Functions *****************************/ @@ -1511,9 +1508,6 @@ namespace { bool InstructionSchedulingWithSSA::runOnFunction(Function &F) { - if (SchedDebugLevel == Sched_Disable) - return false; - SchedGraphSet graphSet(&F, target); if (SchedDebugLevel >= Sched_PrintSchedGraphs) -- 2.34.1