[llvm-dev] [RFC] Enable Partial Inliner by default

Graham Yiu via llvm-dev llvm-dev at lists.llvm.org
Tue Nov 7 08:19:35 PST 2017


Hi Evgeny,

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.

Cheers,

Graham Yiu
LLVM Compiler Development
IBM Toronto Software Lab
Office: (905) 413-4077      C2-707/8200/Markham
Email: gyiu at ca.ibm.com



From:	Graham Yiu/Toronto/IBM
To:	Evgeny Astigeevich <Evgeny.Astigeevich at arm.com>
Cc:	"junbuml at codeaurora.org" <junbuml at codeaurora.org>,
            "llvm-dev at lists.llvm.org" <llvm-dev at lists.llvm.org>, nd
            <nd at arm.com>, Tobias Grosser <tobias.grosser at inf.ethz.ch>
Date:	11/03/2017 12:40 PM
Subject:	Re: [llvm-dev] [RFC] Enable Partial Inliner by default


Hi Evgeny,

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.

Cheers,

Graham Yiu
LLVM Compiler Development
IBM Toronto Software Lab
Office: (905) 413-4077      C2-707/8200/Markham
Email: gyiu at ca.ibm.com




From:	Evgeny Astigeevich <Evgeny.Astigeevich at arm.com>
To:	Tobias Grosser <tobias.grosser at inf.ethz.ch>, Graham Yiu
            <gyiu at ca.ibm.com>
Cc:	"junbuml at codeaurora.org" <junbuml at codeaurora.org>,
            "llvm-dev at lists.llvm.org" <llvm-dev at lists.llvm.org>, nd
            <nd at arm.com>
Date:	11/03/2017 12:18 PM
Subject:	Re: [llvm-dev] [RFC] Enable Partial Inliner by default



Hi,



We'd like to check impact on armv7m and armv6m targets, especially code
size. We have not tried the partial inliner on them.



Could a decision to turn it on by default wait for results?



Thanks,

Evgeny Astigeevich

The Arm Compiler Optimization team



-----Original Message-----

From: llvm-dev <llvm-dev-bounces at lists.llvm.org> on behalf of Tobias
Grosser via llvm-dev <llvm-dev at lists.llvm.org>

Reply-To: Tobias Grosser <tobias.grosser at inf.ethz.ch>

Date: Thursday, 2 November 2017 at 23:32

To: Graham Yiu <gyiu at ca.ibm.com>, "llvm-dev at lists.llvm.org"
<llvm-dev at lists.llvm.org>

Cc: "junbuml at codeaurora.org" <junbuml at codeaurora.org>

Subject: Re: [llvm-dev] [RFC] Enable Partial Inliner by default



Hi Graham,



I think this is a good idea. It is also useful for libquantum, where

together with some other changes, it enables Polly to perform libfusion.



The ARM people also played with the partial inliner and might have

feedback.



Best,

Tobias



On Thu, Nov 2, 2017, at 23:05, Graham Yiu via llvm-dev wrote:

>

> Forgot to add that all experiments were done with '-O3 -m64

> -fexperimental-new-pass-manager'.

>

> Graham Yiu

> LLVM Compiler Development

> IBM Toronto Software Lab

> Office: (905) 413-4077      C2-707/8200/Markham

> Email: gyiu at ca.ibm.com

>

>

>

> From:   Graham Yiu/Toronto/IBM

> To:     llvm-dev at lists.llvm.org

> Cc:     junbuml at codeaurora.org, xinliangli at gmail.com

> Date:   11/02/2017 05:26 PM

> Subject:        [RFC] Enable Partial Inliner by default

>

>

> Hello,

>

> I'd like to propose turning on the partial inliner

> (-enable-partial-inlining) by default.

>

> 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.

>

> -------------------------------------

> Brief description of Partial Inlining

> -------------------------------------

> 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.

>

> eg.

>

> void foo() {

>   bar();

>   // rest of the code in foo

> }

>

> void bar() {

>   if (X)

>     return;

>   // rest of code (to be outlined)

> }

>

> After Partial Inlining:

>

> void foo() {

>   if (!X)

>     bar.outlined();

>   // rest of the code in foo

> }

>

> void bar.outlined() {

>   // rest of the code in bar

> }

>

>

> Here are the numbers on a Power8 PPCLE running Ubuntu 15.04 in ST-mode

>

> ----------------------------------------------

> Runtime performance (speed)

> ----------------------------------------------

> Workload                Improvement

> --------                -----------

> SPEC2006(C/C++) 0.06%           (geomean)

> SPEC2017(C/C++) 0.10%           (geomean)

> ----------------------------------------------

> Compile time performance for Bootstrapped LLVM

> ----------------------------------------------

> Workload                Improvement

> --------                -----------

> SPEC2006(C/C++) 0.41%           (cumulative)

> SPEC2017(C/C++) -0.16%  (cumulative)

> lnt                     0.61%           (geomean)

> ----------------------------------------------

> Compile time performance

> ----------------------------------------------

> Workload                Increase

> --------                --------

> SPEC2006(C/C++) 1.31%           (cumulative)

> SPEC2017(C/C++) 0.25%           (cumulative)

> ----------------------------------------------

> Code size

> ----------------------------------------------

> Workload                Increase

> --------                --------

> SPEC2006(C/C++) 3.90%           (geomean)

> SPEC2017(C/C++) 1.05%           (geomean)

>

> 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%.

>

> NOTE2: There is a patch up for review on Phabricator to enhance the

> partial

> inliner with the presence of profiling information (

>
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=
).

>

>

> Graham Yiu

> LLVM Compiler Development

> IBM Toronto Software Lab

> Office: (905) 413-4077      C2-707/8200/Markham

> Email: gyiu at ca.ibm.com

>

> _______________________________________________

> LLVM Developers mailing list

> llvm-dev at lists.llvm.org

>
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=


> Email had 1 attachment:

> + graycol.gif

>   1k (image/gif)

_______________________________________________

LLVM Developers mailing list

llvm-dev at lists.llvm.org

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=










-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20171107/582d7388/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: graycol.gif
Type: image/gif
Size: 105 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20171107/582d7388/attachment.gif>


More information about the llvm-dev mailing list