<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Mar 2, 2016 at 4:12 PM, Philip Reames <span dir="ltr"><<a href="mailto:listmail@philipreames.com" target="_blank">listmail@philipreames.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">reames added a comment.<br>
<span class=""><br>
In <a href="http://reviews.llvm.org/D17652#364797" rel="noreferrer" target="_blank">http://reviews.llvm.org/D17652#364797</a>, @davidxl wrote:<br>
<br>
> A general problem I see in address sinking optimization is the lack of global cost analysis -- the analysis should consider<br>
><br>
> 1. the cost of the folded instruction (if the address can be folded in)<br>
> 2. whether the original address instruction can be eliminated (for instance, only sunk into some of the uses)<br>
> 3. if the address can not be folded, what is the additional cost<br>
> 4. what is the estimated register pressure reduction with the address sinking<br>
<br>
<br>
</span>I'm confused by your comment.  Are you talking about my changes, or the existing code?  The existing code does most of this (except 1) and my extension preserves all of that except when duplicating into a cold call.<br></blockquote><div><br></div><div><br></div><div>Mostly the existing code, but you new code introduces a new dimension to it. IIUC, the new code introduces the case where address computation may not be folded away so there is also potential size increase? Perhaps guard this change with 'not built for Os or Oz' ?</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<span class=""><br>
> The above should be all weighted with the block frequency information.<br>
<br>
<br>
</span>While I agree, that's a separate change - particularly since CFG does not currently use profiling info at all.<br></blockquote><div><br></div><div>Perhaps add a comment there to future cleanup ?</div><div><br></div><div>thanks,</div><div><br></div><div>David </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
<br>
<a href="http://reviews.llvm.org/D17652" rel="noreferrer" target="_blank">http://reviews.llvm.org/D17652</a><br>
<br>
<br>
<br>
</blockquote></div><br></div></div>