[PATCH] D36172: [InstCombine] Improve profitability check for folding PHI args

Daniel Berlin via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Aug 1 14:34:39 PDT 2017


dberlin added a comment.

Please please don't :)
Doing it the way this codepath does it can be exponential time/space
NewGVN will do the same thing, and in fact, catch all  possible cases that can exist here in polynomial time.

I think the original check is a good compromise, but you are changing it to spend  O(N^2) time per phi node, which, imho, is not good.
I strongly think we should just leave this one alone and be happy for now.
If you have pressing testcases, i'm happy to try to put someone on finishing the small amount of work on NewGVN bugs to get it on by default :)


https://reviews.llvm.org/D36172





More information about the llvm-commits mailing list