<div dir="ltr"><br><div class="gmail_extra"><br><br><div class="gmail_quote">On Wed, Mar 12, 2014 at 7:51 AM, Rafael Espíndola <span dir="ltr"><<a href="mailto:rafael.espindola@gmail.com" target="_blank">rafael.espindola@gmail.com</a>></span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">+int computeThresholdFromOptLevels(unsigned OptLevel, unsigned SizeOptLevel)<br>
<br>
Make it static for clarity. The function could probably early returns:<br>
<br>
if (OptLevel > 2)<br>
  return 275;<br>
if (SizeOptLevel == 1)<br>
  return 75;<br>
if (SizeOptLevel == 2)<br>
  return 25;<br>
return 225;<br>
<br></blockquote><div><br></div><div>Yeah, the original code is definitely convoluted. I chose to keep it in the initial patch to make it more obvious that I don't change any functionality. But the actual commit follows your reordering advice.</div>

<div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
LGTM with that.<br></blockquote><div><br></div><div>Thanks for the review.</div><div><br></div><div>r203669</div><div>and in Clang - r203673</div><div><br></div><div>Eli </div><div><br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

<div><div class="h5">
<br>
On 11 March 2014 18:59, Eli Bendersky <<a href="mailto:eliben@google.com">eliben@google.com</a>> wrote:<br>
> Hello,<br>
><br>
> There's a bit of duplicated "magic" code in opt.cpp and Clang's CodeGen that<br>
> computes the inliner threshold from opt level and size opt level.<br>
><br>
> This patch moves the code to a function that lives alongside the inliner<br>
> itself, providing a convenient overload to the inliner creation.<br>
><br>
> A separate patch can be committed to Clang to use this once it's committed<br>
> to LLVM. Standalone tools that use the inlining pass can also avoid<br>
> duplicating this code and fearing it will go out of sync.<br>
><br>
> PTAL,<br>
> Eli<br>
><br>
><br>
</div></div>> _______________________________________________<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>
><br>
</blockquote></div><br></div></div>