[PATCH] D18155: Instcombine: try to avoid wasted work in ConstantFold

Philip Reames via llvm-commits llvm-commits at lists.llvm.org
Wed Mar 16 10:40:36 PDT 2016

reames added a comment.

In http://reviews.llvm.org/D18155#376179, @escha wrote:

> My guess is most of these are doing absolutely nothing useful, but I don't know enough about constexprs or the design of instcombine to understand why it's done this way.

My suspicion is that you've stumbled onto a deeper issue with the design of constexpr canonicalization.  I think it would be good to raise this on llvm-dev for further discussion.  I suspect there's a better design here which could address InstCombine and all other users of ConstantFolding in a single go.  In particular, it *really* bothers me that ConstantFolding is doing a recursive search in this case.

p.s. If you want to split out the reordering change, I'd be happy to sign off on that part without waiting for the broader design discussion.  Just make sure you make the change in the main loop as well.  That's obviously a good idea.



More information about the llvm-commits mailing list