<div dir="ltr"><div dir="ltr"><div class="gmail_default" style="font-family:monospace;font-size:small;color:#000000"><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, Mar 17, 2021 at 12:13 PM Wenlei He via Phabricator <<a href="mailto:reviews@reviews.llvm.org">reviews@reviews.llvm.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">wenlei added a comment.<br>
<br>
I think size cap might be better than call site counts, and query inliner instr size should not have cost.<br>
<br>
2nd thought on the warning, how about this. The goal is help save time for everyone.<br>
<br>
- One switch for -inline-size-limit, default to huge value (could be INT_MAX). When the limit is hit, we emit a warning, but don’t stop inlining. This make it obvious to everyone when cgscc inlining is causing extremely long build time. With default to huge value, it should not fire at all so nothing would break due to warning as error. But people may choose to set a lower value (e.g. we may use a lower value internally, it may break build, but the hope is to capture extremely slow builds and bloated codegen quickly)<br>
- Another switch to -stop-inline-for-size-limit, default to off. When this is enabled, cgscc inline will stop when the above size limit is hit, no warning is issued since this is asked by user explicitly. This serves as a possible mitigation for bloated inlining without changing global threshold, and it's also cohesive with #1.<br>
<br>
<span class="gmail_default" style="font-family:monospace;font-size:small;color:rgb(0,0,0)"></span></blockquote><div> </div><div><div class="gmail_default" style="font-family:monospace;font-size:small;color:rgb(0,0,0)">This SGTM.</div><br></div><div><br></div><div class="gmail_default" style="font-family:monospace;font-size:small;color:rgb(0,0,0)">David</div><div class="gmail_default" style="font-family:monospace;font-size:small;color:rgb(0,0,0)"></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><span class="gmail_default" style="font-family:monospace;font-size:small;color:rgb(0,0,0)"></span><br>
<br>
<br>
Repository:<br>
rG LLVM Github Monorepo<br>
<br>
CHANGES SINCE LAST ACTION<br>
<a href="https://reviews.llvm.org/D98481/new/" rel="noreferrer" target="_blank">https://reviews.llvm.org/D98481/new/</a><br>
<br>
<a href="https://reviews.llvm.org/D98481" rel="noreferrer" target="_blank">https://reviews.llvm.org/D98481</a><br>
<br>
</blockquote></div></div>