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

Daniel Berlin via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Aug 2 08:10:05 PDT 2017


dberlin added a comment.

NewGVN currently has a limitation that davide is fixing around recursive translation, so it won't get it quite yet.
Note also that the usual transform it performs is to remove the redundancy, not to just sink (which was the original usecase for the transform).
If you mainly care about the sinking, it may require a bit of thought.  It's also worth noting our dividing line for instcombine was one expressed to me as "local transforms", and this is most certainly not :)
(IE if this is a local transform, i can express PRE in InstCombine, and have it do global PRE).

Note that the check is not just quadratic in the worst case because instcombine iterates.   This mechanism of transforming phi of ops into op of phis  can be exponential time worst case even without instcombine's iteration :) 
But i'll agree that i would expect the early exits to be hit mostly.

In any case, is this testcase the main testcase you care about?  Is it a real performance win for your platform in general (IE how much is it buying us)?


https://reviews.llvm.org/D36172





More information about the llvm-commits mailing list