<html><body><p><font size="2">Hi Adrian,</font><br><br><font size="2">As far as I know, the code extractor takes care of fixing up the debug information, if necessary.  However, I haven't verified this myself and to be honest my knowledge of how debug information is represented in LLVM is limited.</font><br><br><font size="2">Cheers,</font><br><br><font size="2">Graham Yiu<br>LLVM Compiler Development<br>IBM Toronto Software Lab<br>Office: (905) 413-4077      C2-707/8200/Markham<br>Email: gyiu@ca.ibm.com</font><br><br><img width="16" height="16" src="cid:1__=8FBB0B5EDFC955868f9e8a93df938690918c8FB@" border="0" alt="Inactive hide details for Adrian Prantl ---11/03/2017 12:21:16 PM---> On Nov 2, 2017, at 3:05 PM, Graham Yiu via llvm-dev <llvm"><font size="2" color="#424282">Adrian Prantl ---11/03/2017 12:21:16 PM---> On Nov 2, 2017, at 3:05 PM, Graham Yiu via llvm-dev <llvm-dev@lists.llvm.org> wrote: ></font><br><br><font size="2" color="#5F5F5F">From:        </font><font size="2">Adrian Prantl <aprantl@apple.com></font><br><font size="2" color="#5F5F5F">To:        </font><font size="2">Graham Yiu <gyiu@ca.ibm.com></font><br><font size="2" color="#5F5F5F">Cc:        </font><font size="2">llvm-dev@lists.llvm.org, junbuml@codeaurora.org</font><br><font size="2" color="#5F5F5F">Date:        </font><font size="2">11/03/2017 12:21 PM</font><br><font size="2" color="#5F5F5F">Subject:        </font><font size="2">Re: [llvm-dev] [RFC] Enable Partial Inliner by default</font><br><font size="2" color="#5F5F5F">Sent by:        </font><font size="2">aprantl@apple.com</font><br><hr width="100%" size="2" align="left" noshade style="color:#8091A5; "><br><br><br><tt><font size="2"><br><br>> On Nov 2, 2017, at 3:05 PM, Graham Yiu via llvm-dev <llvm-dev@lists.llvm.org> wrote:<br>> <br>> Forgot to add that all experiments were done with '-O3 -m64 -fexperimental-new-pass-manager'.<br>> <br>> Graham Yiu<br>> LLVM Compiler Development<br>> IBM Toronto Software Lab<br>> Office: (905) 413-4077 C2-707/8200/Markham<br>> Email: gyiu@ca.ibm.com<br>> <br>> <graycol.gif>Graham Yiu---11/02/2017 05:26:58 PM---Hello, I'd like to propose turning on the partial inliner (-enable-partial-inlining) by default.<br>> <br>> From: Graham Yiu/Toronto/IBM<br>> To: llvm-dev@lists.llvm.org<br>> Cc: junbuml@codeaurora.org, xinliangli@gmail.com<br>> Date: 11/02/2017 05:26 PM<br>> Subject: [RFC] Enable Partial Inliner by default<br>> <br>> <br>> <br>> Hello,<br>> <br>> I'd like to propose turning on the partial inliner (-enable-partial-inlining) by default.<br>> <br>> We've seen small gains on SPEC2006/2017 runtimes as well as lnt compile-times with a 2nd stage bootstrap of LLVM. We also saw positive gains on our internal workloads.<br>> <br>> -------------------------------------<br>> Brief description of Partial Inlining<br>> -------------------------------------<br>> A pass in opt that runs after the normal inlining pass. Looks for branches to a return block in the entry and immediate successor blocks of a function. If found, it outlines the rest of the function using the CodeExtractor.<br><br>Since you mention outlining of code: Does this negatively affect the debug info quality?<br><br>-- adrian<br><br><br>> It then attempts to inline the leftover entry block (and possibly one or more of its successors) to all its callers. This effectively peels the early return block(s) into the caller, which could be executed without incurring the call overhead of the function just to return immediately. Inlining and call overhead cost, as well as branch probabilities of the return block(s) are taken into account before inlining is done. If inlining is not successful, then the changes are discarded.<br>> <br>> eg.<br>> <br>> void foo() {<br>> bar();<br>> // rest of the code in foo<br>> }<br>> <br>> void bar() {<br>> if (X)<br>> return;<br>> // rest of code (to be outlined)<br>> }<br>> <br>> After Partial Inlining:<br>> <br>> void foo() {<br>> if (!X)<br>> bar.outlined();<br>> // rest of the code in foo<br>> }<br>> <br>> void bar.outlined() {<br>> // rest of the code in bar<br>> }<br>> <br>> <br>> Here are the numbers on a Power8 PPCLE running Ubuntu 15.04 in ST-mode<br>> <br>> ----------------------------------------------<br>> Runtime performance (speed)<br>> ----------------------------------------------<br>> Workload Improvement<br>> -------- -----------<br>> SPEC2006(C/C++) 0.06% (geomean)<br>> SPEC2017(C/C++) 0.10% (geomean) <br>> ----------------------------------------------<br>> Compile time performance for Bootstrapped LLVM<br>> ----------------------------------------------<br>> Workload Improvement<br>> -------- -----------<br>> SPEC2006(C/C++) 0.41% (cumulative)<br>> SPEC2017(C/C++) -0.16% (cumulative)<br>> lnt 0.61% (geomean)<br>> ----------------------------------------------<br>> Compile time performance<br>> ----------------------------------------------<br>> Workload Increase<br>> -------- --------<br>> SPEC2006(C/C++) 1.31% (cumulative)<br>> SPEC2017(C/C++) 0.25% (cumulative)<br>> ----------------------------------------------<br>> Code size<br>> ----------------------------------------------<br>> Workload Increase<br>> -------- --------<br>> SPEC2006(C/C++) 3.90% (geomean)<br>> SPEC2017(C/C++) 1.05% (geomean)<br>> <br>> NOTE1: Code size increase in SPEC2006 was mainly attributed to benchmark "astar", which increased by 86%. Removing this outlier, we get a more reasonable increase of 0.58%.<br>> <br>> NOTE2: There is a patch up for review on Phabricator to enhance the partial inliner with the presence of profiling information (</font></tt><tt><font size="2"><a href="https://urldefense.proofpoint.com/v2/url?u=https-3A__reviews.llvm.org_D38190&d=DwICAg&c=jf_iaSHvJObTbx-siA1ZOg&r=4ST7e3kMd0GTi3w9ByK5Cw&m=vHBrl23Udp8MJ7l9cceP-oY_G3_H42oc7IuMFbx90_Y&s=Hzu_t0oXe3-l5xEwxx6s4eBMb6oKEGsi1vxFkqGHlaI&e=">https://urldefense.proofpoint.com/v2/url?u=https-3A__reviews.llvm.org_D38190&d=DwICAg&c=jf_iaSHvJObTbx-siA1ZOg&r=4ST7e3kMd0GTi3w9ByK5Cw&m=vHBrl23Udp8MJ7l9cceP-oY_G3_H42oc7IuMFbx90_Y&s=Hzu_t0oXe3-l5xEwxx6s4eBMb6oKEGsi1vxFkqGHlaI&e=</a></font></tt><tt><font size="2">).<br>> <br>> <br>> Graham Yiu<br>> LLVM Compiler Development<br>> IBM Toronto Software Lab<br>> Office: (905) 413-4077 C2-707/8200/Markham<br>> Email: gyiu@ca.ibm.com<br>> <br>> <br>> _______________________________________________<br>> LLVM Developers mailing list<br>> llvm-dev@lists.llvm.org<br>> </font></tt><tt><font size="2"><a href="https://urldefense.proofpoint.com/v2/url?u=http-3A__lists.llvm.org_cgi-2Dbin_mailman_listinfo_llvm-2Ddev&d=DwICAg&c=jf_iaSHvJObTbx-siA1ZOg&r=4ST7e3kMd0GTi3w9ByK5Cw&m=vHBrl23Udp8MJ7l9cceP-oY_G3_H42oc7IuMFbx90_Y&s=pjIBJMaH7s_RCLdln5Z-pyBGmlqXE43Ch0Rh6GnY9oU&e=">https://urldefense.proofpoint.com/v2/url?u=http-3A__lists.llvm.org_cgi-2Dbin_mailman_listinfo_llvm-2Ddev&d=DwICAg&c=jf_iaSHvJObTbx-siA1ZOg&r=4ST7e3kMd0GTi3w9ByK5Cw&m=vHBrl23Udp8MJ7l9cceP-oY_G3_H42oc7IuMFbx90_Y&s=pjIBJMaH7s_RCLdln5Z-pyBGmlqXE43Ch0Rh6GnY9oU&e=</a></font></tt><tt><font size="2"><br><br></font></tt><br><br><BR>
</body></html>