<div dir="ltr"><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Aug 27, 2014 at 11:52 AM, Yin Ma <span dir="ltr"><<a href="mailto:yinma@codeaurora.org" target="_blank">yinma@codeaurora.org</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">For iterative framework for inliner and other optimization, for inliner itself, I believe two<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">passes should be good enough, one at the very beginning of a pass queue and one at the <u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">end.  In general, the size of IR is very linear to the one after optimization.</span></p></blockquote>
<div><br></div><div>This is definitely not the case.</div><div><br></div><div>Things like SROA, SSA-formation, and DCE after constants are propagated thanks to SROA, GVN etc., will often dramatically change the code size. Perhaps it is the case for very small isolated benchmarks that have already been heavily optimized by hand, but across almost all the code and benchmarks I care about in the real world (sadly, SPEC is not the real world or even close) the size of IR after optimization has much higher variance -- sometimes it is *much* smaller.</div>
<div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"> Some optimizations<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">increases the ir size, such as unrolling. For increased Ir callees, actually, for most of time, we <u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">do not inline it again in the iterative framework. So if we only add another pass to catch <u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">all decreased ir callees, it should be enough in my opinion.</span></p></blockquote></div><br>You're not addressing the case when inlining itself *changes* how much the optimizer decreases the IR... When that happens, you really need to iterate with the inliner to get the best results.</div>
</div>