MI Sched: Update the way resources are tracked so the current heuristics make more sense.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@186632 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Andrew Trick 2013-07-19 00:20:07 +00:00
parent d639206676
commit 4e3898056e

View File

@ -1253,7 +1253,7 @@ public:
// Count scheduled resources that have been executed. Resources are // Count scheduled resources that have been executed. Resources are
// considered executed if they become ready in the time that it takes to // considered executed if they become ready in the time that it takes to
// saturate any resource including the one in question. Counts are scaled // saturate any resource including the one in question. Counts are scaled
// for direct comparison with other resources. Counts ca be compared with // for direct comparison with other resources. Counts can be compared with
// MOps * getMicroOpFactor and Latency * getLatencyFactor. // MOps * getMicroOpFactor and Latency * getLatencyFactor.
SmallVector<unsigned, 16> ExecutedResCounts; SmallVector<unsigned, 16> ExecutedResCounts;
@ -1658,7 +1658,7 @@ void ConvergingScheduler::SchedBoundary::setPolicy(CandPolicy &Policy,
<< Rem->CriticalPath << "\n"); << Rem->CriticalPath << "\n");
} }
// If the same resource is limiting inside and outside the zone, do nothing. // If the same resource is limiting inside and outside the zone, do nothing.
if (IsResourceLimited && OtherResLimited && (ZoneCritResIdx == OtherCritIdx)) if (ZoneCritResIdx == OtherCritIdx)
return; return;
DEBUG( DEBUG(
@ -1760,11 +1760,9 @@ countResource(unsigned PIdx, unsigned Cycles, unsigned ReadyCycle) {
assert(Rem->RemainingCounts[PIdx] >= Count && "resource double counted"); assert(Rem->RemainingCounts[PIdx] >= Count && "resource double counted");
Rem->RemainingCounts[PIdx] -= Count; Rem->RemainingCounts[PIdx] -= Count;
// Check if this resource exceeds the current critical resource by a full // Check if this resource exceeds the current critical resource. If so, it
// cycle. If so, it becomes the critical resource. // becomes the critical resource.
if (ZoneCritResIdx != PIdx if (ZoneCritResIdx != PIdx && (getResourceCount(PIdx) > getCriticalCount())) {
&& ((int)(getResourceCount(PIdx) - getCriticalCount())
>= (int)SchedModel->getLatencyFactor())) {
ZoneCritResIdx = PIdx; ZoneCritResIdx = PIdx;
DEBUG(dbgs() << " *** Critical resource " DEBUG(dbgs() << " *** Critical resource "
<< getResourceName(PIdx) << ": " << getResourceName(PIdx) << ": "