HomePhabricator

[IRCE] Do not transform if loop has small number of iterations

Authored by skatkov on Oct 16 2020, 12:23 AM.

Description

[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

Details

Committed
skatkovOct 19 2020, 8:33 PM
Reviewer
mkazantsev
Differential Revision
D89541: [IRCE] Do not transform is loop has small number of iterations
Parents
rGad0b2d9d46a3: Add llvm_unreachable to avoid MSVC warning
Branches
Unknown
Tags
Unknown