<div dir="ltr">Fixed.<div><br></div><div>David</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, May 12, 2016 at 5:32 AM, Teresa Johnson <span dir="ltr"><<a href="mailto:tejohnson@google.com" target="_blank">tejohnson@google.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Wed, May 11, 2016 at 7:04 PM, Xinliang David Li via llvm-commits <span dir="ltr"><<a href="mailto:llvm-commits@lists.llvm.org" target="_blank">llvm-commits@lists.llvm.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Author: davidxl<br>
Date: Wed May 11 21:04:41 2016<br>
New Revision: 269266<br>
<br>
URL: <a href="http://llvm.org/viewvc/llvm-project?rev=269266&view=rev" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project?rev=269266&view=rev</a><br>
Log:<br>
[Layout] Add a new option (NFC)<br>
<br>
Currently cost based loop rotation algo can only be turned on with<br>
two conditions: the function has real profile data, and -precise-rotation-cost<br>
flag is turned on. This is not convenient for developers to experiment<br>
when profile is not available. Add a new option to force the new<br>
rotation algorithm -force-precise-rotation-cost<br>
<br>
<br>
<br>
Modified:<br>
    llvm/trunk/lib/CodeGen/MachineBlockPlacement.cpp<br>
<br>
Modified: llvm/trunk/lib/CodeGen/MachineBlockPlacement.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/MachineBlockPlacement.cpp?rev=269266&r1=269265&r2=269266&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/MachineBlockPlacement.cpp?rev=269266&r1=269265&r2=269266&view=diff</a><br>
==============================================================================<br>
--- llvm/trunk/lib/CodeGen/MachineBlockPlacement.cpp (original)<br>
+++ llvm/trunk/lib/CodeGen/MachineBlockPlacement.cpp Wed May 11 21:04:41 2016<br>
@@ -99,6 +99,11 @@ static cl::opt<bool><br>
                         cl::desc("Model the cost of loop rotation more "<br>
                                  "precisely by using profile data."),<br>
                         cl::init(false), cl::Hidden);<br>
+static cl::opt<bool><br>
+    ForcePreciseRotationCost("force-precise-rotation-cost",<br>
+                             cl::desc("Model the cost of loop rotation more "<br>
+                                      "precisely by using profile data."),<br></blockquote><div><br></div><div>This is the same description as PreciseRotationCost. Is the idea that there may be some profile data just not in the entry block? When would that happen in practice? If just for experimentation, would another approach be to add a profile count to the entry block or is that not feasible? Otherwise, maybe change this to something like "Force the modeling of loop rotating costs using possibly incomplete profile data"?</div><div><br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
+                             cl::init(false), cl::Hidden);<br>
<br>
 static cl::opt<unsigned> MisfetchCost(<br>
     "misfetch-cost",<br>
@@ -1126,7 +1131,8 @@ void MachineBlockPlacement::buildLoopCha<br>
   // this loop by modeling costs more precisely which requires the profile data<br>
   // for better layout.<br>
   bool RotateLoopWithProfile =<br>
-      PreciseRotationCost && F.getFunction()->getEntryCount();<br>
+      ForcePreciseRotationCost ||<br>
+      (PreciseRotationCost && F.getFunction()->getEntryCount());<br>
<br>
   // First check to see if there is an obviously preferable top block for the<br>
   // loop. This will default to the header, but may end up as one of the<br>
<br>
<br>
_______________________________________________<br>
llvm-commits mailing list<br>
<a href="mailto:llvm-commits@lists.llvm.org" target="_blank">llvm-commits@lists.llvm.org</a><br>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits</a><span class="HOEnZb"><font color="#888888"><br>
</font></span></blockquote></div><span class="HOEnZb"><font color="#888888"><br><br clear="all"><div><br></div>-- <br><div><span style="font-family:Times;font-size:medium"><table cellspacing="0" cellpadding="0"><tbody><tr style="color:rgb(85,85,85);font-family:sans-serif;font-size:small"><td nowrap style="border-top-style:solid;border-top-color:rgb(213,15,37);border-top-width:2px">Teresa Johnson |</td><td nowrap style="border-top-style:solid;border-top-color:rgb(51,105,232);border-top-width:2px"> Software Engineer |</td><td nowrap style="border-top-style:solid;border-top-color:rgb(0,153,57);border-top-width:2px"> <a href="mailto:tejohnson@google.com" target="_blank">tejohnson@google.com</a> |</td><td nowrap style="border-top-style:solid;border-top-color:rgb(238,178,17);border-top-width:2px"> <a href="tel:408-460-2413" value="+14084602413" target="_blank">408-460-2413</a></td></tr></tbody></table></span></div>
</font></span></div></div>
</blockquote></div><br></div>