<div class="gmail_quote">On Fri, Mar 9, 2012 at 12:43 AM, Duncan Sands <span dir="ltr"><<a href="mailto:baldrick@free.fr">baldrick@free.fr</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div id=":98p">Hi Chandler, on a meta note, in the long run is it really a good idea to add<br>
ever more special case logic here?  I can't help feeling that there needs to<br>
be an infrastructure that can uniformly catch everything here.  On IRC I did<br>
mutter about instsimplify, however a large part of instsimplify (and constant<br>
folding) is a list of patterns like this: x ^ x -> 0, (x+y)-x -> y, etc.  Maybe<br>
we should factorize this kind of thing out in some way that in can be applied to<br>
instructions (instsimplify), constants (constant folding), "instructions we<br>
would get if we actually inlined this thing" (inline cost), SCEV (loops) etc.</div></blockquote></div><br><div>I completely agree with this sentiment by the way. I was grumbling about the same thing when working on this. That said, in the here and now I don't have a strategy for doing this factoring. I've thought about it a tiny bit, and nothing obvious jumps out at me. So until we have it, I'd like to keep hill climbing toward better code gen...</div>
<div><br></div><div>On the other hand, long term I'm also interested in finding a way to factor things and stop special casing so much....</div>