<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On 1 May 2014 11:12, Rafael EspĂndola <span dir="ltr"><<a href="mailto:rafael.espindola@gmail.com" target="_blank">rafael.espindola@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="">On 1 May 2014 14:08, Reid Kleckner <<a href="mailto:rnk@google.com">rnk@google.com</a>> wrote:<br>
> I talked about this with Nick in person months ago, and my understanding is<br>
> that GlobalOpt is also an enabling optimization that needs to run early.<br>
> For example, if we can eliminate an initializer to an internal global with<br>
> no other stores to it, we can propagate the result.<br>
><br>
> Maybe we should run it twice.<br>
<br>
</div>That is probably fine, we just have to make sure compile time doesn't<br>
surfer too much.<br></blockquote><div></div></div><br></div><div class="gmail_extra">There are many cases where another run of globalopt at the end would clean things up.</div><div class="gmail_extra"><br></div><div class="gmail_extra">
I have a few concerns. One is that globalopt can miscompile, and I'm afraid of making it do more or learn new tricks because that may expose its miscompiley underbelly. The second is that a late run of globalopt opens up all manner of new opportunities for the rest of the scalar optimizers, which we don't run again. That's a sign that we should be designing it differently, I just haven't thought about how exactly.</div>
<div class="gmail_extra"><br></div><div class="gmail_extra">Teaching -globaldce about the ctors and dtors list sounds like a great plan to me.</div><div class="gmail_extra"><br></div><div class="gmail_extra">Nick</div></div>