[PATCH] D89541: [IRCE] Do not transform is loop has small number of iterations

Serguei Katkov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Oct 16 04:23:42 PDT 2020


skatkov created this revision.
skatkov added reviewers: ebrevnov, dantrushin, asbirlea, mkazantsev.
Herald added a subscriber: hiraditya.
Herald added a project: LLVM.
skatkov requested review of this revision.

IRCE has some overhead for runtime checks and in case number of iteration is small
the overhead can kill the benefit from optimizations.

This CL bases on BlockFrequencyInfo of pre-header and header to estimate the
number of loop iterations. If it is less than irce-min-estimated-iters we do not transform the loop.

Probably it is better to make more complex cost model but for simplicity it seems the be enough.

The usage of BFI is added only for new pass manager and tries to use it efficiently.


https://reviews.llvm.org/D89541

Files:
  llvm/lib/Transforms/Scalar/InductiveRangeCheckElimination.cpp
  llvm/test/Transforms/IRCE/low-iterations.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D89541.298592.patch
Type: text/x-patch
Size: 5322 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20201016/b667844e/attachment.bin>


More information about the llvm-commits mailing list