diff options
author | Andrew Trick <atrick@apple.com> | 2012-12-18 20:52:49 +0000 |
---|---|---|
committer | Andrew Trick <atrick@apple.com> | 2012-12-18 20:52:49 +0000 |
commit | 071966f6bf2a535b318995cfa5d0f5b641fb4e14 (patch) | |
tree | da05583394bd88f220bde8de60af31930ce49b7c /lib/CodeGen/MachineScheduler.cpp | |
parent | 7f1d6d688f6ae288a16a4151e8a27b518d97f6f7 (diff) | |
download | external_llvm-071966f6bf2a535b318995cfa5d0f5b641fb4e14.zip external_llvm-071966f6bf2a535b318995cfa5d0f5b641fb4e14.tar.gz external_llvm-071966f6bf2a535b318995cfa5d0f5b641fb4e14.tar.bz2 |
MISched: minor improvement, initialize remaining resources before the first scheduling decision.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@170449 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/MachineScheduler.cpp')
-rw-r--r-- | lib/CodeGen/MachineScheduler.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/lib/CodeGen/MachineScheduler.cpp b/lib/CodeGen/MachineScheduler.cpp index c7afa08..d49eda2 100644 --- a/lib/CodeGen/MachineScheduler.cpp +++ b/lib/CodeGen/MachineScheduler.cpp @@ -1166,6 +1166,16 @@ init(ScheduleDAGMI *DAG, const TargetSchedModel *SchedModel) { RemainingCounts[PIdx] += (Factor * PI->Cycles); } } + for (unsigned PIdx = 0, PEnd = SchedModel->getNumProcResourceKinds(); + PIdx != PEnd; ++PIdx) { + if ((int)(RemainingCounts[PIdx] - RemainingCounts[CritResIdx]) + >= (int)SchedModel->getLatencyFactor()) { + CritResIdx = PIdx; + } + } + MaxRemainingCount = std::max( + RemainingMicroOps * SchedModel->getMicroOpFactor(), + RemainingCounts[CritResIdx]); } void ConvergingScheduler::SchedBoundary:: |