[all-commits] [llvm/llvm-project] 452714: [BPI] Keep BPI available in loop passes through Lo...

annamthomas via All-commits all-commits at lists.llvm.org
Thu Sep 30 07:27:28 PDT 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 452714f8f8037ff37f9358317651d1652e231db2
      https://github.com/llvm/llvm-project/commit/452714f8f8037ff37f9358317651d1652e231db2
  Author: Anna Thomas <anna at azul.com>
  Date:   2021-09-30 (Thu, 30 Sep 2021)

  Changed paths:
    M llvm/include/llvm/Analysis/LoopAnalysisManager.h
    M llvm/include/llvm/Transforms/Scalar/LoopPassManager.h
    M llvm/lib/Passes/PassBuilder.cpp
    M llvm/lib/Transforms/Scalar/LoopDistribute.cpp
    M llvm/lib/Transforms/Scalar/LoopLoadElimination.cpp
    M llvm/lib/Transforms/Scalar/LoopPassManager.cpp
    M llvm/lib/Transforms/Scalar/LoopPredication.cpp
    M llvm/lib/Transforms/Utils/LoopVersioning.cpp
    M llvm/lib/Transforms/Vectorize/LoopVectorize.cpp
    M llvm/test/Transforms/LoopPredication/preserve-bpi.ll

  Log Message:
  -----------
  [BPI] Keep BPI available in loop passes through LoopStandardAnalysisResults

This is analogous to 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 in the pipeline use BPI currently.
However, since BPI wasn't previously preserved in loop passes, the loop
predication pass was invoking BPI *on the entire
function* every time it ran in an LPM.  This caused massive compile time
in our downstream LPM invocation which contained loop predication.

See updated test with an invocation of a loop-pipeline containing loop
predication and -debug-pass turned ON.

Reviewed-By: asbirlea, modimo
Differential Revision: https://reviews.llvm.org/D110438




More information about the All-commits mailing list