[PATCH] D77523: Add CanonicalizeFreezeInLoops pass

Juneyoung Lee via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Apr 6 22:20:46 PDT 2020


aqjune added a comment.

In D77523#1965758 <https://reviews.llvm.org/D77523#1965758>, @jdoerfert wrote:

> I might have missed this but what was the reason we don't do this as part of LICM?


The motivation was that freezes inserted by DivRemPairs should be moved out of the loop so LoopStrengthReduce (in TargetPassConfig::addIRPasses) optimizes successfully.
Currently LICM isn't there between the two. There is SimplifyCFGPass , but it does not have dependency on loop analyses and it fires regardless of whether it is LTO or not (whereas the regression happened only when LTO was enabled), so seemed it wasn't a good candidate for having this.
In terms of reusability of this pass, I believe this pass can be inserted after e.g. passes like LoopUnswitch inserted freeze.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D77523





More information about the llvm-commits mailing list