<html><body><p><font size="2">Hi Evgeny,</font><br><br><font size="2">Ah, yes, I guess I wasn't clear in my original email.  I am proposing to enable it by default on both the new and current pass managers.  However, I didn't collect any data for the current pass manager, since I'm assuming (hoping) the new pass manager will be the new default at some point in the future.</font><br><br><font size="2">I don't think the partial inliner is enabled by default on the new pass manager (unless something changed recently).  I do know it requires a slightly different option to enable (-enable-npm-partial-inlining).</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__=8FBB0B5FDFEF713A8f9e8a93df938690918c8FB@" border="0" alt="Inactive hide details for Evgeny Astigeevich ---11/02/2017 06:19:18 PM---Hi Graham, Is your RFC to enable it with the current p"><font size="2" color="#424282">Evgeny Astigeevich ---11/02/2017 06:19:18 PM---Hi Graham, Is your RFC to enable it with the current pass manager? If so, do you have benchmark data</font><br><br><font size="2" color="#5F5F5F">From:        </font><font size="2">Evgeny Astigeevich <Evgeny.Astigeevich@arm.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">"junbuml@codeaurora.org" <junbuml@codeaurora.org>, "llvm-dev@lists.llvm.org" <llvm-dev@lists.llvm.org>, nd <nd@arm.com></font><br><font size="2" color="#5F5F5F">Date:        </font><font size="2">11/02/2017 06:19 PM</font><br><font size="2" color="#5F5F5F">Subject:        </font><font size="2">Re: [llvm-dev] [RFC] Enable Partial Inliner by default</font><br><hr width="100%" size="2" align="left" noshade style="color:#8091A5; "><br><br><br><font face="Calibri">Hi Graham,</font><br><font face="Calibri"> </font><br><font face="Calibri">Is your RFC to enable it with the current pass manager? If so, do you have benchmark data for it?</font><br><font face="Calibri">Am I correct the new pass manager turns the partial inliner by default?</font><br><font face="Calibri"> </font><br><font face="Calibri">Thanks,</font><br><font face="Calibri">Evgeny Astigeevich</font><br><font face="Calibri"> </font><br><b><font face="Calibri">From: </font></b><font face="Calibri">llvm-dev <llvm-dev-bounces@lists.llvm.org> on behalf of Graham Yiu via llvm-dev <llvm-dev@lists.llvm.org></font><b><font face="Calibri"><br>Reply-To: </font></b><font face="Calibri">Graham Yiu <gyiu@ca.ibm.com></font><b><font face="Calibri"><br>Date: </font></b><font face="Calibri">Thursday, 2 November 2017 at 22:05</font><b><font face="Calibri"><br>To: </font></b><font face="Calibri">"llvm-dev@lists.llvm.org" <llvm-dev@lists.llvm.org></font><b><font face="Calibri"><br>Cc: </font></b><font face="Calibri">"junbuml@codeaurora.org" <junbuml@codeaurora.org></font><b><font face="Calibri"><br>Subject: </font></b><font face="Calibri">Re: [llvm-dev] [RFC] Enable Partial Inliner by default</font><br><font face="Calibri"> </font><p><a name="_MailOriginalBody"></a><font size="2" face="Courier New">Forgot to add that all experiments were done with '-O3 -m64 -fexperimental-new-pass-manager'.</font><br><font size="2"><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</font><br><br><img src="cid:2__=8FBB0B5FDFEF713A8f9e8a93df938690918c8FB@" width="16" height="16" alt="Inactive hide details for Graham Yiu---11/02/2017 05:26:58 PM---Hello, I'd like to propose turning on the partial inliner (-ena"><font size="2" color="#424282">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.</font><br><font size="2" color="#5F5F5F"><br>From: </font><font size="2">Graham Yiu/Toronto/IBM</font><font size="2" color="#5F5F5F"><br>To: </font><font size="2">llvm-dev@lists.llvm.org</font><font size="2" color="#5F5F5F"><br>Cc: </font><font size="2">junbuml@codeaurora.org, xinliangli@gmail.com</font><font size="2" color="#5F5F5F"><br>Date: </font><font size="2">11/02/2017 05:26 PM</font><font size="2" color="#5F5F5F"><br>Subject: </font><font size="2">[RFC] Enable Partial Inliner by default</font><br><hr width="100%" size="2" align="left" noshade><br><font face="Calibri"><br></font><font size="2" face="Courier New"><br>Hello,</font><font face="Calibri"><br></font><font size="2" face="Courier New"><br>I'd like to propose turning on the partial inliner (-enable-partial-inlining) by default.</font><font face="Calibri"><br></font><font size="2" face="Courier New"><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.</font><font face="Calibri"><br></font><font size="2" face="Courier New"><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. 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.</font><font face="Calibri"><br></font><font size="2" face="Courier New"><br>eg.</font><font face="Calibri"><br></font><font size="2" face="Courier New"><br>void foo() {<br>bar();<br>// rest of the code in foo<br>}</font><font face="Calibri"><br></font><font size="2" face="Courier New"><br>void bar() {<br>if (X)<br>return;<br>// rest of code (to be outlined)<br>}</font><font face="Calibri"><br></font><font size="2" face="Courier New"><br>After Partial Inlining:</font><font face="Calibri"><br></font><font size="2" face="Courier New"><br>void foo() {<br>if (!X)<br>bar.outlined();<br>// rest of the code in foo<br>}</font><font face="Calibri"><br></font><font size="2" face="Courier New"><br>void bar.outlined() {<br>// rest of the code in bar<br>}</font><font face="Calibri"><br><br></font><font size="2" face="Courier New"><br>Here are the numbers on a Power8 PPCLE running Ubuntu 15.04 in ST-mode</font><font face="Calibri"><br></font><font size="2" face="Courier New"><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)</font><font face="Calibri"><br></font><font size="2" face="Courier New"><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%.</font><font face="Calibri"><br></font><font size="2" face="Courier New"><br>NOTE2: There is a patch up for review on Phabricator to enhance the partial inliner with the presence of profiling information (</font><a href="https://urldefense.proofpoint.com/v2/url?u=https-3A__reviews.llvm.org_D38190&d=DwMGaQ&c=jf_iaSHvJObTbx-siA1ZOg&r=4ST7e3kMd0GTi3w9ByK5Cw&m=-Yf4PAfEywc8W7WCAEOXevVYFiRFHXqWqVSoyiPfVek&s=KOXQGZm3zs0-56qYOyexUEKwUlWpWI61YkUBVUjHGeo&e="><u><font size="2" color="#0000FF" face="Courier New">https://reviews.llvm.org/D38190</font></u></a><font size="2" face="Courier New">).</font><font face="Calibri"><br><br></font><font size="2" face="Calibri"><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</font><font face="Calibri"><br><br><br></font><br><br><BR>
</body></html>