summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/MachineScheduler.cpp
diff options
context:
space:
mode:
authorAndrew Trick <atrick@apple.com>2013-07-19 00:20:07 +0000
committerAndrew Trick <atrick@apple.com>2013-07-19 00:20:07 +0000
commitb13ef17a149973087d8b11c716b3574e820deeed (patch)
tree085d79dea4886a45e71b17abf89a24e6d4fe8cff /llvm/lib/CodeGen/MachineScheduler.cpp
parent7a2eca0f0f55253de13b6e39ec369f5d18c2dc4e (diff)
downloadbcm5719-llvm-b13ef17a149973087d8b11c716b3574e820deeed.tar.gz
bcm5719-llvm-b13ef17a149973087d8b11c716b3574e820deeed.zip
MI Sched: Update the way resources are tracked so the current heuristics make more sense.
llvm-svn: 186632
Diffstat (limited to 'llvm/lib/CodeGen/MachineScheduler.cpp')
-rw-r--r--llvm/lib/CodeGen/MachineScheduler.cpp12
1 files changed, 5 insertions, 7 deletions
diff --git a/llvm/lib/CodeGen/MachineScheduler.cpp b/llvm/lib/CodeGen/MachineScheduler.cpp
index ad55a77a499..314f621c092 100644
--- a/llvm/lib/CodeGen/MachineScheduler.cpp
+++ b/llvm/lib/CodeGen/MachineScheduler.cpp
@@ -1253,7 +1253,7 @@ public:
// Count scheduled resources that have been executed. Resources are
// considered executed if they become ready in the time that it takes to
// 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.
SmallVector<unsigned, 16> ExecutedResCounts;
@@ -1658,7 +1658,7 @@ void ConvergingScheduler::SchedBoundary::setPolicy(CandPolicy &Policy,
<< Rem->CriticalPath << "\n");
}
// If the same resource is limiting inside and outside the zone, do nothing.
- if (IsResourceLimited && OtherResLimited && (ZoneCritResIdx == OtherCritIdx))
+ if (ZoneCritResIdx == OtherCritIdx)
return;
DEBUG(
@@ -1760,11 +1760,9 @@ countResource(unsigned PIdx, unsigned Cycles, unsigned ReadyCycle) {
assert(Rem->RemainingCounts[PIdx] >= Count && "resource double counted");
Rem->RemainingCounts[PIdx] -= Count;
- // Check if this resource exceeds the current critical resource by a full
- // cycle. If so, it becomes the critical resource.
- if (ZoneCritResIdx != PIdx
- && ((int)(getResourceCount(PIdx) - getCriticalCount())
- >= (int)SchedModel->getLatencyFactor())) {
+ // Check if this resource exceeds the current critical resource. If so, it
+ // becomes the critical resource.
+ if (ZoneCritResIdx != PIdx && (getResourceCount(PIdx) > getCriticalCount())) {
ZoneCritResIdx = PIdx;
DEBUG(dbgs() << " *** Critical resource "
<< getResourceName(PIdx) << ": "
OpenPOWER on IntegriCloud