<div dir="ltr">But if you mean you guarantee only to change decisions in the case each has a single use (and you are not just counting the uses in the current reassociate tree), you may actually be able to guarantee it shrinks it globally.<div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Apr 27, 2017 at 4:42 PM, Daniel Berlin <span dir="ltr"><<a href="mailto:dberlin@dberlin.org" target="_blank">dberlin@dberlin.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><span class=""><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="m_1959527690568505341HOEnZb"><div class="m_1959527690568505341h5"><br>
> Maybe?<br>
><br>
> Remember that this reassociate has *zero* global view of expressions.<br>
> It only makes locally good choices.<br>
><br>
> IE given:<br>
>      bar(a + b);<br>
>      bar((a + 2) + b);<br>
><br>
><br>
> This reassociate will process the a + b and a + 2 + b separately,<br>
<br>
</div></div>This patch will not change the original handling of this case because<br>
both a and b has >1 uses.<br>
<div class="m_1959527690568505341HOEnZb"><div class="m_1959527690568505341h5"><br></div></div></blockquote></span><div><br>Sure, i was just pointing out it is only handling local tree-level stuff, and the way it forms trees will not necessarily guarantee that the overall live range of the values is reduced (precisely because the trees it forms do not contain all uses).</div><div><br></div><div>IE it is guaranteed to try to shrink a live range locally, and either succeed or do nothing.</div><div>That may or may not shrink a live range globally, and may increase the live range locally.</div><div><br></div><div><br></div><div>IE</div><div>       A</div><div>        | </div><div>A     |</div><div>|       | </div><div>|       | </div><div>A      A</div><div>       </div><div>A<br>|</div><div>|</div><div>A   </div><div><br></div><div>-></div><div><br></div><div>A<br>|</div><div>|<br>A   A</div><div>      |</div><div>      |</div><div>A   A</div><div>|</div><div>|<br>A</div><div><br></div><div><br></div><div>This has shrunk the live range of A locally, but made it worse globally.</div><div><br></div><div><br></div><div><br></div></div></div></div>
</blockquote></div><br></div>