<html><body><p><font size="2">Hello,</font><br><br><font size="2">I've posted a preliminary patch on Phabricator </font><br><br><a href="https://reviews.llvm.org/D40477"><font size="2">https://reviews.llvm.org/D40477</font></a><br><br><font size="2">that enables the partial inliner by default and disables the partial inlining pass during ThinLTO prepare/prelink and leaves it to the actual ThinLTO pass to do the work.  The regular LTO prepare/prelink pass has been left alone since ThinLTO has a customized one.</font><br><br><font size="2">I'll gather some SPEC numbers this week to make sure disabling PI during ThinLTO prepare/prelink has a positive/neutral impact.</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__=8FBB0B76DFF7FF138f9e8a93df938690918c8FB@" border="0" alt="Inactive hide details for Graham Yiu---11/14/2017 04:40:28 PM---Hi Evgeny, I agree that we probably need to tweak when the part"><font size="2" color="#424282">Graham Yiu---11/14/2017 04:40:28 PM---Hi Evgeny, I agree that we probably need to tweak when the partial inliner should run when using LTO</font><br><br><font size="2" color="#5F5F5F">From:        </font><font size="2">Graham Yiu/Toronto/IBM</font><br><font size="2" color="#5F5F5F">To:        </font><font size="2">Evgeny Astigeevich <Evgeny.Astigeevich@arm.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>, Tobias Grosser <tobias.grosser@inf.ethz.ch></font><br><font size="2" color="#5F5F5F">Date:        </font><font size="2">11/14/2017 04:40 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><font size="2">Hi Evgeny,</font><br><br><font size="2">I agree that we probably need to tweak when the partial inliner should run when using LTO/thinLTO.  The easiest thing to do is likely to just disable partial inlining in the pre-LTO pass during compilation, so we don't outline things that the LTO inliner will eventually inline again.</font><br><br><font size="2">As for the code size increases you're seeing, it's not too surprising, though it would've been nice to see some performance speed-ups.  Do you know if we just happen to increase the size of functions that are infrequently executed?</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><br><img width="16" height="16" src="cid:1__=8FBB0B76DFF7FF138f9e8a93df938690918c8FB@" border="0" alt="Inactive hide details for Evgeny Astigeevich ---11/13/2017 09:47:45 AM---Hi Graham, I created a bug report with a reproducer fo"><font size="2" color="#424282">Evgeny Astigeevich ---11/13/2017 09:47:45 AM---Hi Graham, I created a bug report with a reproducer for the failures I’ve got: <a href="https://urldefense.pr">https://urldefense.pr</a></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>, Tobias Grosser <tobias.grosser@inf.ethz.ch>, nd <nd@arm.com></font><br><font size="2" color="#5F5F5F">Date:        </font><font size="2">11/13/2017 09:47 AM</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">I created a bug report with a reproducer for the failures I’ve got: </font><a href="https://urldefense.proofpoint.com/v2/url?u=https-3A__bugs.llvm.org_show-5Fbug.cgi-3Fid-3D35288&d=DwMGaQ&c=jf_iaSHvJObTbx-siA1ZOg&r=4ST7e3kMd0GTi3w9ByK5Cw&m=O8SuY5fPg0KTG59tA1joRSQoBEN51SL4f2H3q22l2o0&s=-poHlswAhfUFibvAaHgA50DN-8Lf6P_vJ6_CJ8MVsT8&e="><u><font color="#0000FF" face="Calibri">https://bugs.llvm.org/show_bug.cgi?id=35288</font></u></a><br><font face="Calibri">I have also found that LTO reverts everything the partial inliner has done. Maybe the partial inliner should not be used at the first LTO phase (compilation).</font><br><font face="Calibri"> </font><br><font face="Calibri">I hope I’ll have a chance to look at the code size regressions this week.</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 Evgeny Astigeevich via llvm-dev <llvm-dev@lists.llvm.org></font><b><font face="Calibri"><br>Reply-To: </font></b><font face="Calibri">Evgeny Astigeevich <Evgeny.Astigeevich@arm.com></font><b><font face="Calibri"><br>Date: </font></b><font face="Calibri">Saturday, 11 November 2017 at 17:21</font><b><font face="Calibri"><br>To: </font></b><font face="Calibri">Graham Yiu <gyiu@ca.ibm.com></font><b><font face="Calibri"><br>Cc: </font></b><font face="Calibri">"junbuml@codeaurora.org" <junbuml@codeaurora.org>, "llvm-dev@lists.llvm.org" <llvm-dev@lists.llvm.org>, Tobias Grosser <tobias.grosser@inf.ethz.ch>, nd <nd@arm.com></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><br><font face="Calibri">Hi Graham,</font><br><font face="Calibri"> </font><br><font face="Calibri">I’ve got results of benchmarking. Armv7m and armv6m are not affected. No changes in scores nor code sizes.</font><br><font face="Calibri">I did some additional benchmarks runs for AArch64 and AArch32.</font><br><font face="Calibri"> </font><br><font face="Calibri">LNT test suite, AArch32, Cortex-A57, -O3 -mcpu=cortex-a57 -mthumb -fomit-frame-pointer</font><br><font face="Calibri">-------------------------------------------------------------------------------------------------------------------------</font><br><font face="Calibri">MultiSource/Applications/aha/aha                          6.73% execution time regression</font><br><font face="Calibri">MultiSource/Applications/sqlite3/sqlite3              2.61% execution time improvement</font><br><font face="Calibri"> </font><br><font face="Calibri">Code size regressions greater than 5%:</font><br><font face="Calibri">MultiSource/Benchmarks/MiBench/automotive-susan/automotive-susan             27.07%</font><br><font face="Calibri">MultiSource/Benchmarks/Fhourstones-3.1/fhourstones3.1                                          16.54%</font><br><font face="Calibri">MultiSource/Benchmarks/Olden/bh/bh                                                                                 10.11%</font><br><font face="Calibri">MultiSource/Benchmarks/McCat/18-imp/imp                                                                    8.38%</font><br><font face="Calibri">SingleSource/Benchmarks/Misc-C++/Large/ray                                                                  6.54%</font><br><font face="Calibri">MultiSource/Benchmarks/Prolangs-C/bison/mybison                                                      5.92%</font><br><font face="Calibri">MultiSource/Benchmarks/MallocBench/espresso/espresso                                          5.09%</font><br><font face="Calibri">-------------------------------------------------------------------------------------------------------------------------</font><br><font face="Calibri"> </font><br><font face="Calibri">LNT test suite, AArch64, Cortex-A57, -O3 -mcpu=cortex-a57 -fomit-frame-pointer</font><br><font face="Calibri">-------------------------------------------------------------------------------------------------------------------------</font><br><font face="Calibri">No significant performance improvements/regressions.</font><br><font face="Calibri"> </font><br><font face="Calibri">Code size regressions greater than 5%:</font><br><font face="Calibri">MultiSource/Benchmarks/MiBench/automotive-susan/automotive-susan             24.51%</font><br><font face="Calibri">MultiSource/Benchmarks/McCat/18-imp/imp                                                                    12.99%</font><br><font face="Calibri">MultiSource/Benchmarks/McCat/08-main/main Profile                                                  8.63%</font><br><font face="Calibri">MultiSource/Benchmarks/Olden/bh/bh                                                                                 8.30%</font><br><font face="Calibri">SingleSource/Benchmarks/Shootout-C++/Shootout-C++-hash                                      7.43%</font><br><font face="Calibri">SingleSource/Benchmarks/Misc-C++/bigfib                                                                          6.24%</font><br><font face="Calibri">MultiSource/Benchmarks/Fhourstones-3.1/fhourstones3.1                                          6.10%</font><br><font face="Calibri">MultiSource/Benchmarks/Prolangs-C/agrep/agrep                                                           5.65%</font><br><font face="Calibri">MultiSource/Benchmarks/Ptrdist/yacr2/yacr2                                                                    5.01%</font><br><font face="Calibri">-------------------------------------------------------------------------------------------------------------------------</font><br><font face="Calibri"> </font><br><font face="Calibri">It can be seen there are the same benchmarks have code size regressed. Are they known?</font><br><font face="Calibri">I am still trying to figure out what is wrong with the debug info.</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><font face="Calibri"> </font><br><b><font face="Calibri">From: </font></b><font face="Calibri">Evgeny Astigeevich <Evgeny.Astigeevich@arm.com></font><b><font face="Calibri"><br>Date: </font></b><font face="Calibri">Friday, 10 November 2017 at 21:28</font><b><font face="Calibri"><br>To: </font></b><font face="Calibri">Graham Yiu <gyiu@ca.ibm.com></font><b><font face="Calibri"><br>Cc: </font></b><font face="Calibri">"junbuml@codeaurora.org" <junbuml@codeaurora.org>, "llvm-dev@lists.llvm.org" <llvm-dev@lists.llvm.org>, nd <nd@arm.com>, Tobias Grosser <tobias.grosser@inf.ethz.ch></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><br><font face="Calibri">Hi Graham,</font><br><font face="Calibri"> </font><br><font face="Calibri">Thank you for offering help. I am trying to create a reproducer. The problem is that the crashes happen whilst LTO is used. One thing I am sure about IR is broken at compile time.</font><br><font face="Calibri"> </font><br><font face="Calibri">Thanks,</font><br><font face="Calibri">Evgeny</font><br><font face="Calibri"> </font><br><b><font face="Calibri">From: </font></b><font face="Calibri">Graham Yiu <gyiu@ca.ibm.com></font><b><font face="Calibri"><br>Date: </font></b><font face="Calibri">Friday, 10 November 2017 at 16:09</font><b><font face="Calibri"><br>To: </font></b><font face="Calibri">Evgeny Astigeevich <Evgeny.Astigeevich@arm.com></font><b><font face="Calibri"><br>Cc: </font></b><font face="Calibri">"junbuml@codeaurora.org" <junbuml@codeaurora.org>, "llvm-dev@lists.llvm.org" <llvm-dev@lists.llvm.org>, nd <nd@arm.com>, Tobias Grosser <tobias.grosser@inf.ethz.ch></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><font size="2">Hi Evgeny,</font><br><font size="2"><br>I just realized that if these are compile-time errors I can help investigate on my end. Do you have something I can use to reproduce?</font><br><font size="2"><br>Cheers,</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__=8FBB0B76DFF7FF138f9e8a93df938690918c8FB@" width="16" height="16" alt="Inactive hide details for Graham Yiu---11/08/2017 06:00:05 PM---Thanks, Evgeny. Let me know if there's something in the partial"><font size="2" color="#424282">Graham Yiu---11/08/2017 06:00:05 PM---Thanks, Evgeny. Let me know if there's something in the partial inlining code that is causing the is</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">Evgeny Astigeevich <Evgeny.Astigeevich@arm.com></font><font size="2" color="#5F5F5F"><br>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>, "Tobias Grosser" <tobias.grosser@inf.ethz.ch></font><font size="2" color="#5F5F5F"><br>Date: </font><font size="2">11/08/2017 06:00 PM</font><font size="2" color="#5F5F5F"><br>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:#000000; "><br><font face="Calibri"><br></font><font size="2" face="Calibri"><br>Thanks, Evgeny.</font><font face="Calibri"><br></font><font size="2" face="Calibri"><br>Let me know if there's something in the partial inlining code that is causing the issue(s) you're seeing.</font><font face="Calibri"><br></font><font size="2" face="Calibri"><br>Cheers,</font><font face="Calibri"><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><img src="cid:2__=8FBB0B76DFF7FF138f9e8a93df938690918c8FB@" width="16" height="16" alt="Inactive hide details for Evgeny Astigeevich ---11/08/2017 05:13:09 PM---Hi Graham, I’ve almost finished my runs. However I’v"><font size="2" color="#424282" face="Calibri">Evgeny Astigeevich ---11/08/2017 05:13:09 PM---Hi Graham, I’ve almost finished my runs. However I’ve got couple compiler crashes:</font><font face="Calibri"><br></font><font size="2" color="#5F5F5F" face="Calibri"><br>From: </font><font size="2" face="Calibri">Evgeny Astigeevich <Evgeny.Astigeevich@arm.com></font><font size="2" color="#5F5F5F" face="Calibri"><br>To: </font><font size="2" face="Calibri">Graham Yiu <gyiu@ca.ibm.com></font><font size="2" color="#5F5F5F" face="Calibri"><br>Cc: </font><font size="2" face="Calibri">"junbuml@codeaurora.org" <junbuml@codeaurora.org>, "llvm-dev@lists.llvm.org" <llvm-dev@lists.llvm.org>, nd <nd@arm.com>, "Tobias Grosser" <tobias.grosser@inf.ethz.ch>, nd <nd@arm.com></font><font size="2" color="#5F5F5F" face="Calibri"><br>Date: </font><font size="2" face="Calibri">11/08/2017 05:13 PM</font><font size="2" color="#5F5F5F" face="Calibri"><br>Subject: </font><font size="2" face="Calibri">Re: [llvm-dev] [RFC] Enable Partial Inliner by default</font><br><hr width="100%" size="2" align="left" noshade style="color:#000000; "><br><font face="Calibri"><br><br><br>Hi Graham,<br><br>I’ve almost finished my runs. However I’ve got couple compiler crashes:<br><br>!dbg attachment points at wrong subprogram for function<br>…<br>LLVM ERROR: Broken module found, compilation aborted!<br><br>This will take some time to investigate.<br><br>Thanks,<br>Evgeny Astigeevich<br><br></font><b><font face="Calibri"><br>From: </font></b><font face="Calibri">Graham Yiu <gyiu@ca.ibm.com></font><b><font face="Calibri"><br>Date: </font></b><font face="Calibri">Tuesday, 7 November 2017 at 16:19</font><b><font face="Calibri"><br>To: </font></b><font face="Calibri">Evgeny Astigeevich <Evgeny.Astigeevich@arm.com></font><b><font face="Calibri"><br>Cc: </font></b><font face="Calibri">"junbuml@codeaurora.org" <junbuml@codeaurora.org>, "llvm-dev@lists.llvm.org" <llvm-dev@lists.llvm.org>, nd <nd@arm.com>, Tobias Grosser <tobias.grosser@inf.ethz.ch></font><b><font face="Calibri"><br>Subject: </font></b><font face="Calibri">Re: [llvm-dev] [RFC] Enable Partial Inliner by default</font><p><a name="_MailOriginalBody"></a><font size="2">Hi Evgeny,<br><br>When you think the experiments on armv7m and armv6m targets will be complete? We're looking to turn this on sooner rather than later, if there aren't objections from folks running on other platforms.<br><br>Cheers,<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</font><br><br><img src="cid:3__=8FBB0B76DFF7FF138f9e8a93df938690918c8FB@" width="16" height="16" alt="Inactive hide details for Graham Yiu---11/03/2017 12:40:10 PM---Hi Evgeny, Yes, please do.  It was our hope that folks would ve"><font size="2" color="#424282">Graham Yiu---11/03/2017 12:40:10 PM---Hi Evgeny, Yes, please do. It was our hope that folks would verify the impact of the partial inline</font><font size="2" color="#5F5F5F"><br><br>From: </font><font size="2">Graham Yiu/Toronto/IBM</font><font size="2" color="#5F5F5F"><br>To: </font><font size="2">Evgeny Astigeevich <Evgeny.Astigeevich@arm.com></font><font size="2" color="#5F5F5F"><br>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>, Tobias Grosser <tobias.grosser@inf.ethz.ch></font><font size="2" color="#5F5F5F"><br>Date: </font><font size="2">11/03/2017 12:40 PM</font><font size="2" color="#5F5F5F"><br>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:#000000; "><br><font face="Calibri"><br></font><font size="2" face="Calibri"><br><br>Hi Evgeny,<br><br>Yes, please do. It was our hope that folks would verify the impact of the partial inliner on the platforms they're currently working on.<br><br>Cheers,<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</font><font face="Calibri"><br><br><br></font><img src="cid:3__=8FBB0B76DFF7FF138f9e8a93df938690918c8FB@" width="16" height="16" alt="Inactive hide details for Evgeny Astigeevich ---11/03/2017 12:18:05 PM---Hi, We'd like to check impact on armv7m and armv6m tar"><font size="2" color="#424282" face="Calibri">Evgeny Astigeevich ---11/03/2017 12:18:05 PM---Hi, We'd like to check impact on armv7m and armv6m targets, especially code size. We have not tried</font><font size="2" color="#5F5F5F" face="Calibri"><br><br>From: </font><font size="2" face="Calibri">Evgeny Astigeevich <Evgeny.Astigeevich@arm.com></font><font size="2" color="#5F5F5F" face="Calibri"><br>To: </font><font size="2" face="Calibri">Tobias Grosser <tobias.grosser@inf.ethz.ch>, Graham Yiu <gyiu@ca.ibm.com></font><font size="2" color="#5F5F5F" face="Calibri"><br>Cc: </font><font size="2" face="Calibri">"junbuml@codeaurora.org" <junbuml@codeaurora.org>, "llvm-dev@lists.llvm.org" <llvm-dev@lists.llvm.org>, nd <nd@arm.com></font><font size="2" color="#5F5F5F" face="Calibri"><br>Date: </font><font size="2" face="Calibri">11/03/2017 12:18 PM</font><font size="2" color="#5F5F5F" face="Calibri"><br>Subject: </font><font size="2" face="Calibri">Re: [llvm-dev] [RFC] Enable Partial Inliner by default</font><br><hr width="100%" size="2" align="left" noshade style="color:#000000; "><br><font face="Calibri"><br><br></font><font size="2" face="Courier New"><br><br>Hi,<br><br><br><br>We'd like to check impact on armv7m and armv6m targets, especially code size. We have not tried the partial inliner on them.<br><br><br><br>Could a decision to turn it on by default wait for results?<br><br><br><br>Thanks,<br><br>Evgeny Astigeevich<br><br>The Arm Compiler Optimization team<br><br><br><br>-----Original Message-----<br><br>From: llvm-dev <llvm-dev-bounces@lists.llvm.org> on behalf of Tobias Grosser via llvm-dev <llvm-dev@lists.llvm.org><br><br>Reply-To: Tobias Grosser <tobias.grosser@inf.ethz.ch><br><br>Date: Thursday, 2 November 2017 at 23:32<br><br>To: Graham Yiu <gyiu@ca.ibm.com>, "llvm-dev@lists.llvm.org" <llvm-dev@lists.llvm.org><br><br>Cc: "junbuml@codeaurora.org" <junbuml@codeaurora.org><br><br>Subject: Re: [llvm-dev] [RFC] Enable Partial Inliner by default<br><br><br><br>Hi Graham,<br><br><br><br>I think this is a good idea. It is also useful for libquantum, where<br><br>together with some other changes, it enables Polly to perform libfusion.<br><br><br><br>The ARM people also played with the partial inliner and might have<br><br>feedback.<br><br><br><br>Best,<br><br>Tobias<br><br><br><br>On Thu, Nov 2, 2017, at 23:05, Graham Yiu via llvm-dev wrote:<br><br>> <br><br>> Forgot to add that all experiments were done with '-O3 -m64<br><br>> -fexperimental-new-pass-manager'.<br><br>> <br><br>> Graham Yiu<br><br>> LLVM Compiler Development<br><br>> IBM Toronto Software Lab<br><br>> Office: (905) 413-4077 C2-707/8200/Markham<br><br>> Email: gyiu@ca.ibm.com<br><br>> <br><br>> <br><br>> <br><br>> From: Graham Yiu/Toronto/IBM<br><br>> To: llvm-dev@lists.llvm.org<br><br>> Cc: junbuml@codeaurora.org, xinliangli@gmail.com<br><br>> Date: 11/02/2017 05:26 PM<br><br>> Subject: [RFC] Enable Partial Inliner by default<br><br>> <br><br>> <br><br>> Hello,<br><br>> <br><br>> I'd like to propose turning on the partial inliner<br><br>> (-enable-partial-inlining) by default.<br><br>> <br><br>> We've seen small gains on SPEC2006/2017 runtimes as well as lnt<br><br>> compile-times with a 2nd stage bootstrap of LLVM. We also saw positive<br><br>> gains on our internal workloads.<br><br>> <br><br>> -------------------------------------<br><br>> Brief description of Partial Inlining<br><br>> -------------------------------------<br><br>> A pass in opt that runs after the normal inlining pass. Looks for<br><br>> branches<br><br>> to a return block in the entry and immediate successor blocks of a<br><br>> function. If found, it outlines the rest of the function using the<br><br>> CodeExtractor. It then attempts to inline the leftover entry block (and<br><br>> possibly one or more of its successors) to all its callers. This<br><br>> effectively peels the early return block(s) into the caller, which could<br><br>> be<br><br>> executed without incurring the call overhead of the function just to<br><br>> return<br><br>> immediately. Inlining and call overhead cost, as well as branch<br><br>> probabilities of the return block(s) are taken into account before<br><br>> inlining<br><br>> is done. If inlining is not successful, then the changes are discarded.<br><br>> <br><br>> eg.<br><br>> <br><br>> void foo() {<br><br>> bar();<br><br>> // rest of the code in foo<br><br>> }<br><br>> <br><br>> void bar() {<br><br>> if (X)<br><br>> return;<br><br>> // rest of code (to be outlined)<br><br>> }<br><br>> <br><br>> After Partial Inlining:<br><br>> <br><br>> void foo() {<br><br>> if (!X)<br><br>> bar.outlined();<br><br>> // rest of the code in foo<br><br>> }<br><br>> <br><br>> void bar.outlined() {<br><br>> // rest of the code in bar<br><br>> }<br><br>> <br><br>> <br><br>> Here are the numbers on a Power8 PPCLE running Ubuntu 15.04 in ST-mode<br><br>> <br><br>> ----------------------------------------------<br><br>> Runtime performance (speed)<br><br>> ----------------------------------------------<br><br>> Workload Improvement<br><br>> -------- -----------<br><br>> SPEC2006(C/C++) 0.06% (geomean)<br><br>> SPEC2017(C/C++) 0.10% (geomean)<br><br>> ----------------------------------------------<br><br>> Compile time performance for Bootstrapped LLVM<br><br>> ----------------------------------------------<br><br>> Workload Improvement<br><br>> -------- -----------<br><br>> SPEC2006(C/C++) 0.41% (cumulative)<br><br>> SPEC2017(C/C++) -0.16% (cumulative)<br><br>> lnt 0.61% (geomean)<br><br>> ----------------------------------------------<br><br>> Compile time performance<br><br>> ----------------------------------------------<br><br>> Workload Increase<br><br>> -------- --------<br><br>> SPEC2006(C/C++) 1.31% (cumulative)<br><br>> SPEC2017(C/C++) 0.25% (cumulative)<br><br>> ----------------------------------------------<br><br>> Code size<br><br>> ----------------------------------------------<br><br>> Workload Increase<br><br>> -------- --------<br><br>> SPEC2006(C/C++) 3.90% (geomean)<br><br>> SPEC2017(C/C++) 1.05% (geomean)<br><br>> <br><br>> NOTE1: Code size increase in SPEC2006 was mainly attributed to benchmark<br><br>> "astar", which increased by 86%. Removing this outlier, we get a more<br><br>> reasonable increase of 0.58%.<br><br>> <br><br>> NOTE2: There is a patch up for review on Phabricator to enhance the<br><br>> partial<br><br>> inliner with the presence of profiling information (<br><br>> </font><a href="https://urldefense.proofpoint.com/v2/url?u=https-3A__reviews.llvm.org_D38190&d=DwIGaQ&c=jf_iaSHvJObTbx-siA1ZOg&r=4ST7e3kMd0GTi3w9ByK5Cw&m=sY89ox2ivgmox5Vg311rAsEr4WFT-o-LRopDU9e7rl0&s=6o17wydYZM0l4kPAb3l3cJ95JRPoYb-3l4sHv-R0GaA&e="><u><font size="2" color="#0000FF" face="Courier New">https://urldefense.proofpoint.com/v2/url?u=https-3A__reviews.llvm.org_D38190&d=DwIGaQ&c=jf_iaSHvJObTbx-siA1ZOg&r=4ST7e3kMd0GTi3w9ByK5Cw&m=sY89ox2ivgmox5Vg311rAsEr4WFT-o-LRopDU9e7rl0&s=6o17wydYZM0l4kPAb3l3cJ95JRPoYb-3l4sHv-R0GaA&e=</font></u></a><font size="2" face="Courier New">).<br><br>> <br><br>> <br><br>> Graham Yiu<br><br>> LLVM Compiler Development<br><br>> IBM Toronto Software Lab<br><br>> Office: (905) 413-4077 C2-707/8200/Markham<br><br>> Email: gyiu@ca.ibm.com<br><br>> <br><br>> _______________________________________________<br><br>> LLVM Developers mailing list<br><br>> llvm-dev@lists.llvm.org<br><br>> </font><a href="https://urldefense.proofpoint.com/v2/url?u=http-3A__lists.llvm.org_cgi-2Dbin_mailman_listinfo_llvm-2Ddev&d=DwIGaQ&c=jf_iaSHvJObTbx-siA1ZOg&r=4ST7e3kMd0GTi3w9ByK5Cw&m=sY89ox2ivgmox5Vg311rAsEr4WFT-o-LRopDU9e7rl0&s=_WAS3iXS9l627yoGcLCkw5IMyoeBRXAb3ShcSIW5qjk&e="><u><font size="2" color="#0000FF" face="Courier New">https://urldefense.proofpoint.com/v2/url?u=http-3A__lists.llvm.org_cgi-2Dbin_mailman_listinfo_llvm-2Ddev&d=DwIGaQ&c=jf_iaSHvJObTbx-siA1ZOg&r=4ST7e3kMd0GTi3w9ByK5Cw&m=sY89ox2ivgmox5Vg311rAsEr4WFT-o-LRopDU9e7rl0&s=_WAS3iXS9l627yoGcLCkw5IMyoeBRXAb3ShcSIW5qjk&e=</font></u></a><font size="2" face="Courier New"><br><br>> Email had 1 attachment:<br><br>> + graycol.gif<br><br>> 1k (image/gif)<br><br>_______________________________________________<br><br>LLVM Developers mailing list<br><br>llvm-dev@lists.llvm.org</font><u><font color="#0000FF" face="Calibri"><br><br></font></u><a href="https://urldefense.proofpoint.com/v2/url?u=http-3A__lists.llvm.org_cgi-2Dbin_mailman_listinfo_llvm-2Ddev&d=DwIGaQ&c=jf_iaSHvJObTbx-siA1ZOg&r=4ST7e3kMd0GTi3w9ByK5Cw&m=sY89ox2ivgmox5Vg311rAsEr4WFT-o-LRopDU9e7rl0&s=_WAS3iXS9l627yoGcLCkw5IMyoeBRXAb3ShcSIW5qjk&e="><u><font size="2" color="#0000FF" face="Courier New">https://urldefense.proofpoint.com/v2/url?u=http-3A__lists.llvm.org_cgi-2Dbin_mailman_listinfo_llvm-2Ddev&d=DwIGaQ&c=jf_iaSHvJObTbx-siA1ZOg&r=4ST7e3kMd0GTi3w9ByK5Cw&m=sY89ox2ivgmox5Vg311rAsEr4WFT-o-LRopDU9e7rl0&s=_WAS3iXS9l627yoGcLCkw5IMyoeBRXAb3ShcSIW5qjk&e=</font></u></a><font size="2" face="Courier New"><br><br><br><br><br></font><font face="Calibri"><br><br><br><br><br><br><br><br><br><br><br><br></font><br><br><br><BR>
</body></html>