[llvm-commits] PATCH: Add support for tracking pairs of pointers with a constant offset to inline cost estimation

Chandler Carruth chandlerc at google.com
Sun Mar 11 16:13:39 PDT 2012


On Fri, Mar 9, 2012 at 12:43 AM, Duncan Sands <baldrick at free.fr> wrote:

> Hi Chandler, on a meta note, in the long run is it really a good idea to
> add
> ever more special case logic here?  I can't help feeling that there needs
> to
> be an infrastructure that can uniformly catch everything here.  On IRC I
> did
> mutter about instsimplify, however a large part of instsimplify (and
> constant
> folding) is a list of patterns like this: x ^ x -> 0, (x+y)-x -> y, etc.
>  Maybe
> we should factorize this kind of thing out in some way that in can be
> applied to
> instructions (instsimplify), constants (constant folding), "instructions we
> would get if we actually inlined this thing" (inline cost), SCEV (loops)
> etc.
>

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...

On the other hand, long term I'm also interested in finding a way to factor
things and stop special casing so much....
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20120311/51cc3fca/attachment.html>


More information about the llvm-commits mailing list