<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><br class=""><div><blockquote type="cite" class=""><div class="">On Aug 26, 2017, at 3:20 PM, Davide Italiano <<a href="mailto:davide@freebsd.org" class="">davide@freebsd.org</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><span style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">On Sat, Aug 26, 2017 at 3:00 PM, Davide Italiano <</span><a href="mailto:davide@freebsd.org" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;" class="">davide@freebsd.org</a><span style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">> wrote:</span><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><blockquote type="cite" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;" class="">On Fri, Aug 25, 2017 at 6:25 PM, Adam Nemet <<a href="mailto:anemet@apple.com" class="">anemet@apple.com</a>> wrote:<br class=""><blockquote type="cite" class=""><br class="">On Aug 25, 2017, at 1:11 PM, Davide Italiano <<a href="mailto:davide@freebsd.org" class="">davide@freebsd.org</a>> wrote:<br class=""><br class="">On Mon, Aug 21, 2017 at 1:00 PM, Haicheng Wu via llvm-commits<br class=""><<a href="mailto:llvm-commits@lists.llvm.org" class="">llvm-commits@lists.llvm.org</a>> wrote:<br class=""><br class="">Author: haicheng<br class="">Date: Mon Aug 21 13:00:09 2017<br class="">New Revision: 311371<br class=""><br class="">URL: <a href="http://llvm.org/viewvc/llvm-project?rev=311371&view=rev" class="">http://llvm.org/viewvc/llvm-project?rev=311371&view=rev</a><br class="">Log:<br class="">[InlineCost] Add cl::opt to allow full inline cost to be computed for<br class="">debugging purposes.<br class=""><br class="">Currently, the inline cost model will bail once the inline cost exceeds the<br class="">inline threshold in order to avoid unnecessary compile-time. However, when<br class="">debugging it is useful to compute the full cost, so this command line option<br class="">is added to override the default behavior.<br class=""><br class="">I took over this work from Chad Rosier (<a href="mailto:mcrosier@codeaurora.org" class="">mcrosier@codeaurora.org</a>).<br class=""><br class=""><br class="">This causes a non-linear increase in the time spent in the inliner for<br class="">us, even with optimization remarks disabled.<br class="">real    0m2.889s<br class="">vs<br class="">real    0m30.429s<br class=""><br class="">I'm under the impression the issue is that for the legacy pass manager<br class="">we create an ORE object on-the-fly (as the inliner is a CGSCC pass,<br class="">and ORE is a FunctionPass analysis), so ORE is always non-null and we<br class="">compute the inlineCost in every case. For the new PM, we can rely on<br class="">proxying, but in the current infrastructure I'm not aware of an easy<br class="">way of obtaining function passes from outer units of IR.<br class="">Adam/Chandler, thoughts?<br class=""><br class=""><br class="">Hi Davide,<br class=""><br class="">Sorry about the delay.  ORE is always set irrespective of whether remarks<br class="">are enabled or not regardless whether you use old or new PM.<br class=""><br class=""><br class="">If nothing comes up, I'm going to pass null instead of ORE in<br class="">InlineSimple to recover from the hit (the feature will be still<br class="">available in the new PM, where we have a much better infrastructure<br class="">for the purpose).<br class=""><br class=""><br class="">I think that this interface is unfortunate conditionalizing on ORE to emit<br class="">remarks.<br class=""><br class="">Also the solution you used from WholeProgDevirt doesn't unfortunately work,<br class="">see <a href="https://bugs.llvm.org/show_bug.cgi?id=32352" class="">https://bugs.llvm.org/show_bug.cgi?id=32352</a> but it’s OK in the short<br class="">term.<br class=""><br class="">Vivek has been working on the actual solution for this to correctly define<br class="">OptimizationRemarkEmitter::allowExtraAnalysis.  Vivek, do you think you can<br class="">get to it soonish?  The API is currently very confusing and I’d like to do<br class="">something about it.<br class=""><br class="">Thanks,<br class="">Adam<br class=""><br class=""><br class=""></blockquote><br class="">Thanks for your reply, Adam.<br class="">I'm going to disable the feature until the API is fleshed out.<br class=""><br class=""></blockquote><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><span style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">Nevermind, ignore my previous reply. What I meant is that I'll leave</span><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><span style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">my workaround in place until the API is fleshed out.</span><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""></div></blockquote><div><br class=""></div><div>OK :).</div><br class=""><blockquote type="cite" class=""><div class=""><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><span style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">Thanks,</span><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><span style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">--</span><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><span style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">Davide</span></div></blockquote></div><br class=""></body></html>