[PATCH] D144045: [InstCombine] Avoid sinking fdiv into a loop

Nikita Popov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon May 15 03:41:14 PDT 2023


nikic added a comment.

My general inclination would be not to do this -- I spent some time looking into it, and I think we would be better off dropping the LoopInfo dependency from InstCombine. Unless we actually want to make it a hard dependency, this is always going to be fragile. It also only addresses one pretty specific case (though an important one, of course), while InstCombine potentially sinking instructions into loops is a generic problem.

My preference for solving this would be to enable the final LICM run for the full LTO pipeline instead. I hate to do this because it has significant compile-time impact (I've been working on reducing LICM compile-time, and it is now much cheaper than when this was first discussed years ago, but it's still fairly expensive). But I think this is the right thing to do despite that. My longer-term goal would be to unify the thin LTO and full LTO optimization pipelines to the degree it is possible, and adding that final LICM run would be required for that as well. As long as we have the pipeline differences, we're going to see these kinds of optimization failures in full LTO, simply because the major production users all use thin LTO and full LTO nowadays tends to be an afterthought only.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D144045/new/

https://reviews.llvm.org/D144045



More information about the llvm-commits mailing list