HomePhabricator

[LoopPredication] Calculate profitability without BPI

Authored by anna on Oct 12 2021, 12:04 PM.

Description

[LoopPredication] Calculate profitability without BPI

Using BPI within loop predication is non-trivial because BPI is only
preserved lossily in loop pass manager (one fix exposed by lossy
preservation is up for review at D111448). However, since loop
predication is only used in downstream pipelines, it is hard to keep BPI
from breaking for incomplete state with upstream changes in BPI.
Also, correctly preserving BPI for all loop passes is a non-trivial
undertaking (D110438 does this lossily), while the benefit of using it
in loop predication isn't clear.

In this patch, we rely on profile metadata to get almost similar benefit as
BPI, without actually using the complete heuristics provided by BPI.
This avoids the compile time explosion we tried to fix with D110438 and
also avoids fragile bugs because BPI can be lossy in loop passes
(D111448).

Reviewed-By: asbirlea, apilipenko
Differential Revision: https://reviews.llvm.org/D111668

Details

Committed
annaOct 19 2021, 11:24 AM
Differential Revision
D111668: [LoopPredication] Calculate profitability without BPI
Parents
rG622c40722e14: [libc++] Make __weekday_from_days private in weekday
Branches
Unknown
Tags
Unknown