[all-commits] [llvm/llvm-project] 940351: [LoopPredication] Calculate profitability without BPI

annamthomas via All-commits all-commits at lists.llvm.org
Tue Oct 19 11:25:24 PDT 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 9403514e764950a0dfcd627fc90c73432314bced
      https://github.com/llvm/llvm-project/commit/9403514e764950a0dfcd627fc90c73432314bced
  Author: Anna Thomas <anna at azul.com>
  Date:   2021-10-19 (Tue, 19 Oct 2021)

  Changed paths:
    M llvm/lib/Transforms/Scalar/LoopPredication.cpp
    M llvm/test/Transforms/LoopPredication/profitability.ll

  Log Message:
  -----------
  [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




More information about the All-commits mailing list