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 | ffb6168e8564e2cfcbca38d0a0d42fa1f10e3b57 (patch) | |
tree | 684abd80e071120243a188b32fc2167e02fb4250 /llvm/lib/CodeGen/MachineScheduler.cpp | |
parent | f00b75117573f7a989243b7724dc7df7b876aa49 (diff) | |
download | bcm5719-llvm-ffb6168e8564e2cfcbca38d0a0d42fa1f10e3b57.tar.gz bcm5719-llvm-ffb6168e8564e2cfcbca38d0a0d42fa1f10e3b57.zip |
MISched: minor improvement, initialize remaining resources before the first scheduling decision.
llvm-svn: 170449
Diffstat (limited to 'llvm/lib/CodeGen/MachineScheduler.cpp')
-rw-r--r-- | llvm/lib/CodeGen/MachineScheduler.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/llvm/lib/CodeGen/MachineScheduler.cpp b/llvm/lib/CodeGen/MachineScheduler.cpp index c7afa08fcde..d49eda24a70 100644 --- a/llvm/lib/CodeGen/MachineScheduler.cpp +++ b/llvm/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:: |