[all-commits] [llvm/llvm-project] 387999: [IRCE] Do not transform if loop has small number o...

serguei-katkov via All-commits all-commits at lists.llvm.org
Mon Oct 19 20:42:40 PDT 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: 38799975ceb21da0e3d2ce70c3f23ba69adf0269
      https://github.com/llvm/llvm-project/commit/38799975ceb21da0e3d2ce70c3f23ba69adf0269
  Author: Serguei Katkov <serguei.katkov at azul.com>
  Date:   2020-10-20 (Tue, 20 Oct 2020)

  Changed paths:
    M llvm/lib/Transforms/Scalar/InductiveRangeCheckElimination.cpp
    A llvm/test/Transforms/IRCE/low-iterations.ll

  Log Message:
  -----------
  [IRCE] Do not transform if loop has small number of iterations

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.

Reviewers: ebrevnov, dantrushin, asbirlea, mkazantsev
Reviewed By: mkazantsev
Subscribers: llvm-commits, fhahn
Differential Revision: https://reviews.llvm.org/D89541




More information about the All-commits mailing list