<div dir="ltr">Or the analysis need to be thought about and extended to not require fix pointing to get the same end result out of the other end of llvm.<div><br></div><div>In situations like this, the real question is "does the same kind of optimized code come out the other end", not "do we perfectly match every little optimization on a per-pass basis". </div><div>Or at least, that's the answer i got about GVN.</div><div>(because trying to replace a do-everything pass that fixpoints with split up passes rarely can match it perfectly Too many second order effects. It shouldn't be your goal)</div><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Sep 11, 2017 at 8:50 AM, Sean Silva <span dir="ltr"><<a href="mailto:chisophugis@gmail.com" target="_blank">chisophugis@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 dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote"><span class="">On Mon, Sep 11, 2017 at 8:14 AM, Daniel Neilson via llvm-dev <span dir="ltr"><<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><br>
Just thinking out loud…. I’m really not familiar with the vast majority of what instcombine does, so please excuse me if my naiveté is too obvious. I can’t help but notice all of the uses of ‘and’ in Daniel B’s description of what instcombine is right now:<br>
<span class="m_-3080562576680889266gmail-"><br>
> On Sep 8, 2017, at 11:27 PM, Daniel Berlin via llvm-dev <<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a>> wrote:<br>
><br>
> FWIW, Before getting to "how to do it", I think InstCombine needs an actual goal.<br>
> Right now it's "do a bunch of instruction combination and canonicalization and random kinds of semi-local optimization with some weird analysis and other stuff in the middle.<br>
> Iterate this as hard as we can"<br>
> Nobody can really draw any real dividing line for what should be there or not except based on how easy or expensive it is to shove it in.<br>
> That's a recipe for pass creep.<br>
<br>
</span>This makes me wonder… is it sensible to be talking about splitting up instcombine into multiple separate passes? Would such a thing even be possible? For example, split by functionality into separate passes that each do one of:<br>
* instruction combinations<br>
* canonicalization<br>
* semi-local optimizations<br>
* etc…<br>
<br>
Or something like that.<br>
<br>
As separate passes, each would probably have a natural way to be implemented effectively and those implementations might vary.<br></blockquote><div><br></div></span><div>One obstacle to that is that currently instcombine has an internal fixed-point iteration that it does.</div><div><br></div><div>So when splitting it into separate passes we would need to either add fixed-point iteration to the pass manager running the separate instcombine passes (extending the pass management in this way is doable and has been explored in the past, e.g. <a href="https://www.youtube.com/watch?v=c7iP43an5_Q" target="_blank">https://www.youtube.com/watch?<wbr>v=c7iP43an5_Q</a> ) or demonstrate/measure that we don't regress without the fixed-point iteration across separate instcombine passes.</div><span class="HOEnZb"><font color="#888888"><div><br></div><div>-- Sean Silva</div><div> </div></font></span><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><span class="">
<br>
-Daniel<br>
<br>
---<br>
Daniel Neilson, Ph.D.<br>
Azul Systems<br>
</span><div class="m_-3080562576680889266gmail-HOEnZb"><div class="m_-3080562576680889266gmail-h5"><br><span class="">
______________________________<wbr>_________________<br>
LLVM Developers mailing list<br>
<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a><br>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/<wbr>mailman/listinfo/llvm-dev</a><br>
</span></div></div></blockquote></div><br></div></div>
</blockquote></div><br></div>