[PATCH] D110438: [BPI] Keep BPI available in loop passes through LoopStandardAnalysisResults

Anna Thomas via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Sep 24 11:59:47 PDT 2021


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

This is analogous to D86156 <https://reviews.llvm.org/D86156> (which preserves "lossy" BFI in loop
passes). Lossy means that the analysis preserved may not be up to date
with regards to new blocks that are added in loop passes, but BPI will
not contain stale pointers to basic blocks that are deleted by the loop
passes.

This is achieved through BasicBlockCallbackVH in BPI, which calls
eraseBlock that updates the data structures in BPI whenever a basic
block is deleted.

This patch does not have any changes in the upstream pipeline, since
none of the loop passes actually use BPI currently. In our downstream
pipeline, we have the LoopPredication pass as part of the loop pass
manager and since BPI isn't preserved, we call BPI *on the entire
function* every time in the LoopPredication invocation. An example
pipeline is: -passes='require<scalar-evolution>,require<branch-prob>,loop-mssa(loop-predication,licm,simple-loop-unswitch<nontrivial>,loop-simplifycfg)'

TODO: Add a test with an invocation of an loop-pipeline containing loop
predication and -debug-pass turned ON.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D110438

Files:
  llvm/include/llvm/Analysis/LoopAnalysisManager.h
  llvm/include/llvm/Transforms/Scalar/LoopPassManager.h
  llvm/lib/Transforms/Scalar/LoopDistribute.cpp
  llvm/lib/Transforms/Scalar/LoopLoadElimination.cpp
  llvm/lib/Transforms/Scalar/LoopPassManager.cpp
  llvm/lib/Transforms/Utils/LoopVersioning.cpp
  llvm/lib/Transforms/Vectorize/LoopVectorize.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D110438.374920.patch
Type: text/x-patch
Size: 9657 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210924/affbf7ad/attachment.bin>


More information about the llvm-commits mailing list