[PATCH] D111448: [BPI] Handle incomplete state in BPI

Anna Thomas via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Oct 8 11:06:00 PDT 2021


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

BPI has this inherent property that once it is computed for a block's
successor, `Probs` data exists for all successors of the block.

However, this is not true during lossy BPI preservation in loop passes,
where BPI is updated when a block is removed, but not when a block is
added (D110438 <https://reviews.llvm.org/D110438>).

This patch makes BPI more relaxed in the face of incomplete information:
removing an assertion that is no longer true and not relying on `Probs`
data to unconditionally have the information for a successor.

The unfortunate bit is that I cannot come up with any unit tests that
trigger the failure when we have lossy BPI (even downstream, the
failures are intemittent within the loop predication pass which uses
BPI). Upstream pipeline does not have a loop pass manager invocation
that uses lossy BPI preservation, but when it does, we will definitely
trip on these issues.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D111448

Files:
  llvm/lib/Analysis/BranchProbabilityInfo.cpp
  llvm/unittests/Analysis/BranchProbabilityInfoTest.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D111448.378312.patch
Type: text/x-patch
Size: 5954 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20211008/46638fc9/attachment.bin>


More information about the llvm-commits mailing list