[PATCH] D111668: [LoopPredication] Calculate profitability without BPI

Anna Thomas via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Oct 12 12:13:22 PDT 2021


anna created this revision.
anna added reviewers: apilipenko, DaniilSuchkov, asbirlea, MaskRay.
Herald added a subscriber: hiraditya.
anna requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

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 <https://reviews.llvm.org/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 <https://reviews.llvm.org/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 <https://reviews.llvm.org/D110438> and
also avoids fragile bugs because BPI can be lossy in loop passes
(D111448 <https://reviews.llvm.org/D111448>).


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D111668

Files:
  llvm/lib/Transforms/Scalar/LoopPredication.cpp
  llvm/test/Transforms/LoopPredication/profitability.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D111668.379135.patch
Type: text/x-patch
Size: 7251 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20211012/1c0a5c1c/attachment.bin>


More information about the llvm-commits mailing list