<html><head><meta http-equiv="Content-Type" content="text/html charset=windows-1252"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><br><div><div>On Dec 3, 2013, at 11:05 AM, Hal Finkel <<a href="mailto:hfinkel@anl.gov">hfinkel@anl.gov</a>> wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div style="font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;">----- Original Message -----<br><blockquote type="cite">From: "Andrew Trick" <<a href="mailto:atrick@apple.com">atrick@apple.com</a>><br>To: "Hal Finkel" <<a href="mailto:hfinkel@anl.gov">hfinkel@anl.gov</a>><br>Cc: "llvm commits" <<a href="mailto:llvm-commits@cs.uiuc.edu">llvm-commits@cs.uiuc.edu</a>><br>Sent: Tuesday, December 3, 2013 12:15:08 PM<br>Subject: Re: [llvm-commits] [llvm] r157977 - in /llvm/trunk: include/llvm/CodeGen/ScheduleHazardRecognizer.h<br>lib/CodeGen/ScoreboardHazardRecognizer.cpp<br><br><br>On Dec 3, 2013, at 9:19 AM, Hal Finkel <<a href="mailto:hfinkel@anl.gov">hfinkel@anl.gov</a>> wrote:<br><br><blockquote type="cite">----- Original Message -----<br><blockquote type="cite">From: "Andrew Trick" <<a href="mailto:atrick@apple.com">atrick@apple.com</a>><br>To: <a href="mailto:llvm-commits@cs.uiuc.edu">llvm-commits@cs.uiuc.edu</a><br>Sent: Monday, June 4, 2012 10:44:32 PM<br>Subject: [llvm-commits] [llvm] r157977 - in /llvm/trunk:<br>include/llvm/CodeGen/ScheduleHazardRecognizer.h<br>lib/CodeGen/ScoreboardHazardRecognizer.cpp<br><br>Author: atrick<br>Date: Mon Jun  4 22:44:32 2012<br>New Revision: 157977<br><br>URL: <a href="http://llvm.org/viewvc/llvm-project?rev=157977&view=rev">http://llvm.org/viewvc/llvm-project?rev=157977&view=rev</a><br>Log:<br>misched: Allow disabling scoreboard hazard checking for subtargets<br>with a<br>valid itinerary but no pipeline stages.<br><br>An itinerary can contain useful scheduling information without<br>specifying pipeline stages for each instruction.<br><br>Modified:<br>  llvm/trunk/include/llvm/CodeGen/ScheduleHazardRecognizer.h<br>  llvm/trunk/lib/CodeGen/ScoreboardHazardRecognizer.cpp<br><br>Modified:<br>llvm/trunk/include/llvm/CodeGen/ScheduleHazardRecognizer.h<br>URL:<br><a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/ScheduleHazardRecognizer.h?rev=157977&r1=157976&r2=157977&view=diff">http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/ScheduleHazardRecognizer.h?rev=157977&r1=157976&r2=157977&view=diff</a><br>==============================================================================<br>--- llvm/trunk/include/llvm/CodeGen/ScheduleHazardRecognizer.h<br>(original)<br>+++ llvm/trunk/include/llvm/CodeGen/ScheduleHazardRecognizer.h Mon<br>Jun  4 22:44:32 2012<br>@@ -46,6 +46,8 @@<br><br> /// atIssueLimit - Return true if no more instructions may be<br> issued in this<br> /// cycle.<br>+  ///<br>+  /// FIXME: remove this once MachineScheduler is the only<br>client.<br></blockquote><br>Does this mean that the MachineScheduler does, or will, do PostRA<br>scheduling as well?<br></blockquote><br>When I implemented MachineScheduler, the plan was that both SD<br>scheduler and PostRA scheduler would be eliminated. Then the<br>scheduling data structure could be further streamlined for<br>simplicity and compile time. I don’t see a fundamental reason the<br>machine scheduler can’t run as a PostRA pass, it just needs to be<br>setup to do that.<br></blockquote><br>Do you mean calling substitutePass(&PostRASchedulerID, &MachineSchedulerID)? Or some kind of 'setup' within the machine scheduler itself?<br></div></blockquote><div><br></div><div>I’m pretty sure something will break when you do that. But it should just be a matter of disabling certain features when running in PostRA mode. e.g. LiveIntervals and RegPressure tracking should be disabled. I’m not sure if you’ll want AliasAnalysis.</div><div><br></div><div>It would be nice if we could conditionally enable postRA scheduling just for blocks with spill/prolog/epilog code. Maybe we want an Analysis pass to remember these blocks.</div><div><br></div>-Andy</div><div><br><blockquote type="cite"><div style="font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;">-Hal<br><br><blockquote type="cite"><br>-Andy<br><br><blockquote type="cite">-Hal<br><br><blockquote type="cite"> virtual bool atIssueLimit() const { return false; }<br><br> /// getHazardType - Return the hazard type of emitting this<br> node.<br>  There are<br><br>Modified: llvm/trunk/lib/CodeGen/ScoreboardHazardRecognizer.cpp<br>URL:<br><a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/ScoreboardHazardRecognizer.cpp?rev=157977&r1=157976&r2=157977&view=diff">http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/ScoreboardHazardRecognizer.cpp?rev=157977&r1=157976&r2=157977&view=diff</a><br>==============================================================================<br>--- llvm/trunk/lib/CodeGen/ScoreboardHazardRecognizer.cpp<br>(original)<br>+++ llvm/trunk/lib/CodeGen/ScoreboardHazardRecognizer.cpp Mon Jun<br>4<br>22:44:32 2012<br>@@ -39,9 +39,9 @@<br> DebugType = ParentDebugType;<br>#endif<br><br>-  // Determine the maximum depth of any itinerary. This<br>determines<br>the<br>-  // depth of the scoreboard. We always make the scoreboard at<br>least<br>1<br>-  // cycle deep to avoid dealing with the boundary condition.<br>+  // Determine the maximum depth of any itinerary. This<br>determines<br>the depth of<br>+  // the scoreboard. We always make the scoreboard at least 1<br>cycle<br>deep to<br>+  // avoid dealing with the boundary condition.<br> unsigned ScoreboardDepth = 1;<br> if (ItinData && !ItinData->isEmpty()) {<br>   IssueWidth = ItinData->IssueWidth;<br>@@ -63,16 +63,22 @@<br>     // Find the next power-of-2 >= ItinDepth<br>     while (ItinDepth > ScoreboardDepth) {<br>       ScoreboardDepth *= 2;<br>+        // Don't set MaxLookAhead until we find at least one<br>nonzero<br>stage.<br>+        // This way, an itinerary with no stages has<br>MaxLookAhead==0, which<br>+        // completely bypasses the scoreboard hazard logic.<br>+        MaxLookAhead = ScoreboardDepth;<br>     }<br>   }<br>-    MaxLookAhead = ScoreboardDepth;<br> }<br><br> ReservedScoreboard.reset(ScoreboardDepth);<br> RequiredScoreboard.reset(ScoreboardDepth);<br><br>-  DEBUG(dbgs() << "Using scoreboard hazard recognizer: Depth = "<br>-               << ScoreboardDepth << '\n');<br>+  if (!MaxLookAhead)<br>+    DEBUG(dbgs() << "Disabled scoreboard hazard recognizer\n");<br>+  else<br>+    DEBUG(dbgs() << "Using scoreboard hazard recognizer: Depth =<br>"<br>+          << ScoreboardDepth << '\n');<br>}<br><br>void ScoreboardHazardRecognizer::Reset() {<br><br><br>_______________________________________________<br>llvm-commits mailing list<br>llvm-commits@cs.uiuc.edu<br>http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits<br><br></blockquote><br>--<br>Hal Finkel<br>Assistant Computational Scientist<br>Leadership Computing Facility<br>Argonne National Laboratory<br></blockquote><br><br></blockquote><br>--<span class="Apple-converted-space"> </span><br>Hal Finkel<br>Assistant Computational Scientist<br>Leadership Computing Facility<br>Argonne National Laboratory</div></blockquote></div><br></body></html>