<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div bgcolor="#FFFFFF" text="#000000"><span class=""><br></span>
I think you're done when you get everything that you have that fits
into a model of local transformations and that should be run to a
fixed point. </div></blockquote><div><br></div><div>Sure, but to point out what you certainly already know, that's almost every optimization you can think of in a compiler.</div><div>For example, I can do PRE this way with no issue (IE generate optimal results).<br></div><div>Same with reassociation, most CSE, etc.</div><div><br></div><div>A very large set of global stuff can be done by "local transform repeated until fixpoint is reached". It's just not optimal time-wise.</div><div><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div bgcolor="#FFFFFF" text="#000000">Certainly an interesting question, but I suspect that
the practical answer is "what's in InstCombine."</div></blockquote><div><br></div><div>At least to me, that's clearly the wrong answer, because instcombine already does a lot of non-local stuff that could be done better elsewhere.</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div bgcolor="#FFFFFF" text="#000000"> To do more in this
sense probably requires some more-general scheme (e.g. equality
saturation).<span class="HOEnZb"><font color="#888888"><br>
<br>
-Hal</font></span><span class=""><br>
<pre class="m_-8253261719320691428moz-signature" cols="72">--
Hal Finkel
Lead, Compiler Technology and Programming Languages
Leadership Computing Facility
Argonne National Laboratory</pre>
</span></div>
</blockquote></div><br></div></div>