<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<!--[if !mso]><style>v\:* {behavior:url(#default#VML);}
o\:* {behavior:url(#default#VML);}
w\:* {behavior:url(#default#VML);}
.shape {behavior:url(#default#VML);}
</style><![endif]--><style><!--
/* Font Definitions */
@font-face
{font-family:"Cambria Math";
panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0in;
margin-bottom:.0001pt;
font-size:11.0pt;
font-family:"Calibri",sans-serif;}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:blue;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{mso-style-priority:99;
color:purple;
text-decoration:underline;}
p.msonormal0, li.msonormal0, div.msonormal0
{mso-style-name:msonormal;
mso-margin-top-alt:auto;
margin-right:0in;
mso-margin-bottom-alt:auto;
margin-left:0in;
font-size:11.0pt;
font-family:"Calibri",sans-serif;}
span.EmailStyle19
{mso-style-type:personal-reply;
font-family:"Calibri",sans-serif;
color:windowtext;
font-weight:normal;
font-style:normal;}
.MsoChpDefault
{mso-style-type:export-only;
font-size:10.0pt;}
@page WordSection1
{size:8.5in 11.0in;
margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
{page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="EN-GB" link="blue" vlink="purple">
<div class="WordSection1">
<p class="MsoNormal"><span style="mso-fareast-language:EN-US">Hi Graham,<o:p></o:p></span></p>
<p class="MsoNormal"><span style="mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="mso-fareast-language:EN-US">Is your RFC to enable it with the current pass manager? If so, do you have benchmark data for it?<o:p></o:p></span></p>
<p class="MsoNormal"><span style="mso-fareast-language:EN-US">Am I correct the new pass manager turns the partial inliner by default?<o:p></o:p></span></p>
<p class="MsoNormal"><span style="mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="mso-fareast-language:EN-US">Thanks,<o:p></o:p></span></p>
<p class="MsoNormal"><span style="mso-fareast-language:EN-US">Evgeny Astigeevich<o:p></o:p></span></p>
<p class="MsoNormal"><span style="mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<div style="border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0in 0in 0in">
<p class="MsoNormal"><b><span style="font-size:12.0pt;color:black">From: </span></b><span style="font-size:12.0pt;color:black">llvm-dev <llvm-dev-bounces@lists.llvm.org> on behalf of Graham Yiu via llvm-dev <llvm-dev@lists.llvm.org><br>
<b>Reply-To: </b>Graham Yiu <gyiu@ca.ibm.com><br>
<b>Date: </b>Thursday, 2 November 2017 at 22:05<br>
<b>To: </b>"llvm-dev@lists.llvm.org" <llvm-dev@lists.llvm.org><br>
<b>Cc: </b>"junbuml@codeaurora.org" <junbuml@codeaurora.org><br>
<b>Subject: </b>Re: [llvm-dev] [RFC] Enable Partial Inliner by default<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<p><a name="_MailOriginalBody"><span style="font-size:10.0pt;font-family:"Courier New"">Forgot to add that all experiments were done with '-O3 -m64 -fexperimental-new-pass-manager'.</span><br>
<br>
</a><span style="mso-bookmark:_MailOriginalBody"><span style="font-size:10.0pt">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</span><br>
<br>
<img width="16" height="16" style="width:.2187in;height:.2187in" id="_x0000_i1026" src="cid:image001.gif@01D35428.9C5445F0" 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"></span><span style="mso-bookmark:_MailOriginalBody"><span style="font-size:10.0pt;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.</span><br>
<br>
</span><span style="mso-bookmark:_MailOriginalBody"><span style="font-size:10.0pt;color:#5F5F5F">From:
</span></span><span style="mso-bookmark:_MailOriginalBody"><span style="font-size:10.0pt">Graham Yiu/Toronto/IBM</span><br>
</span><span style="mso-bookmark:_MailOriginalBody"><span style="font-size:10.0pt;color:#5F5F5F">To:
</span></span><span style="mso-bookmark:_MailOriginalBody"><span style="font-size:10.0pt">llvm-dev@lists.llvm.org</span><br>
</span><span style="mso-bookmark:_MailOriginalBody"><span style="font-size:10.0pt;color:#5F5F5F">Cc:
</span></span><span style="mso-bookmark:_MailOriginalBody"><span style="font-size:10.0pt">junbuml@codeaurora.org, xinliangli@gmail.com</span><br>
</span><span style="mso-bookmark:_MailOriginalBody"><span style="font-size:10.0pt;color:#5F5F5F">Date:
</span></span><span style="mso-bookmark:_MailOriginalBody"><span style="font-size:10.0pt">11/02/2017 05:26 PM</span><br>
</span><span style="mso-bookmark:_MailOriginalBody"><span style="font-size:10.0pt;color:#5F5F5F">Subject:
</span></span><span style="mso-bookmark:_MailOriginalBody"><span style="font-size:10.0pt">[RFC] Enable Partial Inliner by default</span><o:p></o:p></span></p>
<div class="MsoNormal"><span style="mso-bookmark:_MailOriginalBody">
<hr size="2" width="100%" noshade="" style="color:#8091A5" align="left">
</span></div>
<p class="MsoNormal"><span style="mso-bookmark:_MailOriginalBody"><br>
<br>
</span><span style="mso-bookmark:_MailOriginalBody"><span style="font-size:10.0pt;font-family:"Courier New"">Hello,</span></span><span style="mso-bookmark:_MailOriginalBody"><br>
<br>
</span><span style="mso-bookmark:_MailOriginalBody"><span style="font-size:10.0pt;font-family:"Courier New"">I'd like to propose turning on the partial inliner (-enable-partial-inlining) by default.</span></span><span style="mso-bookmark:_MailOriginalBody"><br>
<br>
</span><span style="mso-bookmark:_MailOriginalBody"><span style="font-size:10.0pt;font-family:"Courier New"">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.</span></span><span style="mso-bookmark:_MailOriginalBody"><br>
<br>
</span><span style="mso-bookmark:_MailOriginalBody"><span style="font-size:10.0pt;font-family:"Courier New"">-------------------------------------</span></span><span style="mso-bookmark:_MailOriginalBody"><br>
</span><span style="mso-bookmark:_MailOriginalBody"><span style="font-size:10.0pt;font-family:"Courier New"">Brief description of Partial Inlining</span></span><span style="mso-bookmark:_MailOriginalBody"><br>
</span><span style="mso-bookmark:_MailOriginalBody"><span style="font-size:10.0pt;font-family:"Courier New"">-------------------------------------</span></span><span style="mso-bookmark:_MailOriginalBody"><br>
</span><span style="mso-bookmark:_MailOriginalBody"><span style="font-size:10.0pt;font-family:"Courier New"">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.</span></span><span style="mso-bookmark:_MailOriginalBody"><br>
<br>
</span><span style="mso-bookmark:_MailOriginalBody"><span style="font-size:10.0pt;font-family:"Courier New"">eg.</span></span><span style="mso-bookmark:_MailOriginalBody"><br>
<br>
</span><span style="mso-bookmark:_MailOriginalBody"><span style="font-size:10.0pt;font-family:"Courier New"">void foo() {</span></span><span style="mso-bookmark:_MailOriginalBody"><br>
</span><span style="mso-bookmark:_MailOriginalBody"><span style="font-size:10.0pt;font-family:"Courier New"">bar();</span></span><span style="mso-bookmark:_MailOriginalBody"><br>
</span><span style="mso-bookmark:_MailOriginalBody"><span style="font-size:10.0pt;font-family:"Courier New"">// rest of the code in foo</span></span><span style="mso-bookmark:_MailOriginalBody"><br>
</span><span style="mso-bookmark:_MailOriginalBody"><span style="font-size:10.0pt;font-family:"Courier New"">}</span></span><span style="mso-bookmark:_MailOriginalBody"><br>
<br>
</span><span style="mso-bookmark:_MailOriginalBody"><span style="font-size:10.0pt;font-family:"Courier New"">void bar() {</span></span><span style="mso-bookmark:_MailOriginalBody"><br>
</span><span style="mso-bookmark:_MailOriginalBody"><span style="font-size:10.0pt;font-family:"Courier New"">if (X)</span></span><span style="mso-bookmark:_MailOriginalBody"><br>
</span><span style="mso-bookmark:_MailOriginalBody"><span style="font-size:10.0pt;font-family:"Courier New"">return;</span></span><span style="mso-bookmark:_MailOriginalBody"><br>
</span><span style="mso-bookmark:_MailOriginalBody"><span style="font-size:10.0pt;font-family:"Courier New"">// rest of code (to be outlined)</span></span><span style="mso-bookmark:_MailOriginalBody"><br>
</span><span style="mso-bookmark:_MailOriginalBody"><span style="font-size:10.0pt;font-family:"Courier New"">}</span></span><span style="mso-bookmark:_MailOriginalBody"><br>
<br>
</span><span style="mso-bookmark:_MailOriginalBody"><span style="font-size:10.0pt;font-family:"Courier New"">After Partial Inlining:</span></span><span style="mso-bookmark:_MailOriginalBody"><br>
<br>
</span><span style="mso-bookmark:_MailOriginalBody"><span style="font-size:10.0pt;font-family:"Courier New"">void foo() {</span></span><span style="mso-bookmark:_MailOriginalBody"><br>
</span><span style="mso-bookmark:_MailOriginalBody"><span style="font-size:10.0pt;font-family:"Courier New"">if (!X)</span></span><span style="mso-bookmark:_MailOriginalBody"><br>
</span><span style="mso-bookmark:_MailOriginalBody"><span style="font-size:10.0pt;font-family:"Courier New"">bar.outlined();</span></span><span style="mso-bookmark:_MailOriginalBody"><br>
</span><span style="mso-bookmark:_MailOriginalBody"><span style="font-size:10.0pt;font-family:"Courier New"">// rest of the code in foo</span></span><span style="mso-bookmark:_MailOriginalBody"><br>
</span><span style="mso-bookmark:_MailOriginalBody"><span style="font-size:10.0pt;font-family:"Courier New"">}</span></span><span style="mso-bookmark:_MailOriginalBody"><br>
<br>
</span><span style="mso-bookmark:_MailOriginalBody"><span style="font-size:10.0pt;font-family:"Courier New"">void bar.outlined() {</span></span><span style="mso-bookmark:_MailOriginalBody"><br>
</span><span style="mso-bookmark:_MailOriginalBody"><span style="font-size:10.0pt;font-family:"Courier New"">// rest of the code in bar</span></span><span style="mso-bookmark:_MailOriginalBody"><br>
</span><span style="mso-bookmark:_MailOriginalBody"><span style="font-size:10.0pt;font-family:"Courier New"">}</span></span><span style="mso-bookmark:_MailOriginalBody"><br>
<br>
<br>
</span><span style="mso-bookmark:_MailOriginalBody"><span style="font-size:10.0pt;font-family:"Courier New"">Here are the numbers on a Power8 PPCLE running Ubuntu 15.04 in ST-mode</span></span><span style="mso-bookmark:_MailOriginalBody"><br>
<br>
</span><span style="mso-bookmark:_MailOriginalBody"><span style="font-size:10.0pt;font-family:"Courier New"">----------------------------------------------</span></span><span style="mso-bookmark:_MailOriginalBody"><br>
</span><span style="mso-bookmark:_MailOriginalBody"><span style="font-size:10.0pt;font-family:"Courier New"">Runtime performance (speed)</span></span><span style="mso-bookmark:_MailOriginalBody"><br>
</span><span style="mso-bookmark:_MailOriginalBody"><span style="font-size:10.0pt;font-family:"Courier New"">----------------------------------------------</span></span><span style="mso-bookmark:_MailOriginalBody"><br>
</span><span style="mso-bookmark:_MailOriginalBody"><span style="font-size:10.0pt;font-family:"Courier New"">Workload Improvement</span></span><span style="mso-bookmark:_MailOriginalBody"><br>
</span><span style="mso-bookmark:_MailOriginalBody"><span style="font-size:10.0pt;font-family:"Courier New"">-------- -----------</span></span><span style="mso-bookmark:_MailOriginalBody"><br>
</span><span style="mso-bookmark:_MailOriginalBody"><span style="font-size:10.0pt;font-family:"Courier New"">SPEC2006(C/C++) 0.06% (geomean)</span></span><span style="mso-bookmark:_MailOriginalBody"><br>
</span><span style="mso-bookmark:_MailOriginalBody"><span style="font-size:10.0pt;font-family:"Courier New"">SPEC2017(C/C++) 0.10% (geomean)
</span></span><span style="mso-bookmark:_MailOriginalBody"><br>
</span><span style="mso-bookmark:_MailOriginalBody"><span style="font-size:10.0pt;font-family:"Courier New"">----------------------------------------------</span></span><span style="mso-bookmark:_MailOriginalBody"><br>
</span><span style="mso-bookmark:_MailOriginalBody"><span style="font-size:10.0pt;font-family:"Courier New"">Compile time performance for Bootstrapped LLVM</span></span><span style="mso-bookmark:_MailOriginalBody"><br>
</span><span style="mso-bookmark:_MailOriginalBody"><span style="font-size:10.0pt;font-family:"Courier New"">----------------------------------------------</span></span><span style="mso-bookmark:_MailOriginalBody"><br>
</span><span style="mso-bookmark:_MailOriginalBody"><span style="font-size:10.0pt;font-family:"Courier New"">Workload Improvement</span></span><span style="mso-bookmark:_MailOriginalBody"><br>
</span><span style="mso-bookmark:_MailOriginalBody"><span style="font-size:10.0pt;font-family:"Courier New"">-------- -----------</span></span><span style="mso-bookmark:_MailOriginalBody"><br>
</span><span style="mso-bookmark:_MailOriginalBody"><span style="font-size:10.0pt;font-family:"Courier New"">SPEC2006(C/C++) 0.41% (cumulative)</span></span><span style="mso-bookmark:_MailOriginalBody"><br>
</span><span style="mso-bookmark:_MailOriginalBody"><span style="font-size:10.0pt;font-family:"Courier New"">SPEC2017(C/C++) -0.16% (cumulative)</span></span><span style="mso-bookmark:_MailOriginalBody"><br>
</span><span style="mso-bookmark:_MailOriginalBody"><span style="font-size:10.0pt;font-family:"Courier New"">lnt 0.61% (geomean)</span></span><span style="mso-bookmark:_MailOriginalBody"><br>
</span><span style="mso-bookmark:_MailOriginalBody"><span style="font-size:10.0pt;font-family:"Courier New"">----------------------------------------------</span></span><span style="mso-bookmark:_MailOriginalBody"><br>
</span><span style="mso-bookmark:_MailOriginalBody"><span style="font-size:10.0pt;font-family:"Courier New"">Compile time performance</span></span><span style="mso-bookmark:_MailOriginalBody"><br>
</span><span style="mso-bookmark:_MailOriginalBody"><span style="font-size:10.0pt;font-family:"Courier New"">----------------------------------------------</span></span><span style="mso-bookmark:_MailOriginalBody"><br>
</span><span style="mso-bookmark:_MailOriginalBody"><span style="font-size:10.0pt;font-family:"Courier New"">Workload Increase</span></span><span style="mso-bookmark:_MailOriginalBody"><br>
</span><span style="mso-bookmark:_MailOriginalBody"><span style="font-size:10.0pt;font-family:"Courier New"">-------- --------</span></span><span style="mso-bookmark:_MailOriginalBody"><br>
</span><span style="mso-bookmark:_MailOriginalBody"><span style="font-size:10.0pt;font-family:"Courier New"">SPEC2006(C/C++) 1.31% (cumulative)</span></span><span style="mso-bookmark:_MailOriginalBody"><br>
</span><span style="mso-bookmark:_MailOriginalBody"><span style="font-size:10.0pt;font-family:"Courier New"">SPEC2017(C/C++) 0.25% (cumulative)</span></span><span style="mso-bookmark:_MailOriginalBody"><br>
</span><span style="mso-bookmark:_MailOriginalBody"><span style="font-size:10.0pt;font-family:"Courier New"">----------------------------------------------</span></span><span style="mso-bookmark:_MailOriginalBody"><br>
</span><span style="mso-bookmark:_MailOriginalBody"><span style="font-size:10.0pt;font-family:"Courier New"">Code size</span></span><span style="mso-bookmark:_MailOriginalBody"><br>
</span><span style="mso-bookmark:_MailOriginalBody"><span style="font-size:10.0pt;font-family:"Courier New"">----------------------------------------------</span></span><span style="mso-bookmark:_MailOriginalBody"><br>
</span><span style="mso-bookmark:_MailOriginalBody"><span style="font-size:10.0pt;font-family:"Courier New"">Workload Increase</span></span><span style="mso-bookmark:_MailOriginalBody"><br>
</span><span style="mso-bookmark:_MailOriginalBody"><span style="font-size:10.0pt;font-family:"Courier New"">-------- --------</span></span><span style="mso-bookmark:_MailOriginalBody"><br>
</span><span style="mso-bookmark:_MailOriginalBody"><span style="font-size:10.0pt;font-family:"Courier New"">SPEC2006(C/C++) 3.90% (geomean)</span></span><span style="mso-bookmark:_MailOriginalBody"><br>
</span><span style="mso-bookmark:_MailOriginalBody"><span style="font-size:10.0pt;font-family:"Courier New"">SPEC2017(C/C++) 1.05% (geomean)</span></span><span style="mso-bookmark:_MailOriginalBody"><br>
<br>
</span><span style="mso-bookmark:_MailOriginalBody"><span style="font-size:10.0pt;font-family:"Courier New"">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%.</span></span><span style="mso-bookmark:_MailOriginalBody"><br>
<br>
</span><span style="mso-bookmark:_MailOriginalBody"><span style="font-size:10.0pt;font-family:"Courier New"">NOTE2: There is a patch up for review on Phabricator to enhance the partial inliner with the presence of profiling information (</span></span><span style="mso-bookmark:_MailOriginalBody"></span><a href="https://reviews.llvm.org/D38190"><span style="mso-bookmark:_MailOriginalBody"><span style="font-size:10.0pt;font-family:"Courier New"">https://reviews.llvm.org/D38190</span></span><span style="mso-bookmark:_MailOriginalBody"></span></a><span style="mso-bookmark:_MailOriginalBody"><span style="font-size:10.0pt;font-family:"Courier New"">).</span></span><span style="mso-bookmark:_MailOriginalBody"><br>
<br>
<br>
</span><span style="mso-bookmark:_MailOriginalBody"><span style="font-size:10.0pt">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</span></span><span style="mso-bookmark:_MailOriginalBody"><br>
<br>
<br>
<br>
</span><o:p></o:p></p>
</div>
</body>
</html>