<div dir="ltr"><div>Hi Andrew!</div><div><br></div>Looks like this triggered an error report on out MSan bootstrap bot. I've tried to fix this in r186658.</div><div class="gmail_extra"><br><br><div class="gmail_quote">
On Fri, Jul 19, 2013 at 4:20 AM, Andrew Trick <span dir="ltr"><<a href="mailto:atrick@apple.com" target="_blank">atrick@apple.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Author: atrick<br>
Date: Thu Jul 18 19:20:07 2013<br>
New Revision: 186632<br>
<br>
URL: <a href="http://llvm.org/viewvc/llvm-project?rev=186632&view=rev" target="_blank">http://llvm.org/viewvc/llvm-project?rev=186632&view=rev</a><br>
Log:<br>
MI Sched: Update the way resources are tracked so the current heuristics make more sense.<br>
<br>
Modified:<br>
    llvm/trunk/lib/CodeGen/MachineScheduler.cpp<br>
<br>
Modified: llvm/trunk/lib/CodeGen/MachineScheduler.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/MachineScheduler.cpp?rev=186632&r1=186631&r2=186632&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/MachineScheduler.cpp?rev=186632&r1=186631&r2=186632&view=diff</a><br>

==============================================================================<br>
--- llvm/trunk/lib/CodeGen/MachineScheduler.cpp (original)<br>
+++ llvm/trunk/lib/CodeGen/MachineScheduler.cpp Thu Jul 18 19:20:07 2013<br>
@@ -1253,7 +1253,7 @@ public:<br>
     // Count scheduled resources that have been executed. Resources are<br>
     // considered executed if they become ready in the time that it takes to<br>
     // saturate any resource including the one in question. Counts are scaled<br>
-    // for direct comparison with other resources. Counts ca be compared with<br>
+    // for direct comparison with other resources. Counts can be compared with<br>
     // MOps * getMicroOpFactor and Latency * getLatencyFactor.<br>
     SmallVector<unsigned, 16> ExecutedResCounts;<br>
<br>
@@ -1658,7 +1658,7 @@ void ConvergingScheduler::SchedBoundary:<br>
           << Rem->CriticalPath << "\n");<br>
   }<br>
   // If the same resource is limiting inside and outside the zone, do nothing.<br>
-  if (IsResourceLimited && OtherResLimited && (ZoneCritResIdx == OtherCritIdx))<br>
+  if (ZoneCritResIdx == OtherCritIdx)<br>
     return;<br>
<br>
   DEBUG(<br>
@@ -1760,11 +1760,9 @@ countResource(unsigned PIdx, unsigned Cy<br>
   assert(Rem->RemainingCounts[PIdx] >= Count && "resource double counted");<br>
   Rem->RemainingCounts[PIdx] -= Count;<br>
<br>
-  // Check if this resource exceeds the current critical resource by a full<br>
-  // cycle. If so, it becomes the critical resource.<br>
-  if (ZoneCritResIdx != PIdx<br>
-      && ((int)(getResourceCount(PIdx) - getCriticalCount())<br>
-          >= (int)SchedModel->getLatencyFactor())) {<br>
+  // Check if this resource exceeds the current critical resource. If so, it<br>
+  // becomes the critical resource.<br>
+  if (ZoneCritResIdx != PIdx && (getResourceCount(PIdx) > getCriticalCount())) {<br>
     ZoneCritResIdx = PIdx;<br>
     DEBUG(dbgs() << "  *** Critical resource "<br>
           << getResourceName(PIdx) << ": "<br>
<br>
<br>
_______________________________________________<br>
llvm-commits mailing list<br>
<a href="mailto:llvm-commits@cs.uiuc.edu">llvm-commits@cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits</a><br>
</blockquote></div><br><br clear="all"><div><br></div>-- <br><div>Alexey Samsonov, MSK</div>
</div>