[all-commits] [llvm/llvm-project] c9b4dc: [FuncSpec][NFC] Avoid redundant computations of Do...

Momchil Velikov via All-commits all-commits at lists.llvm.org
Fri Oct 28 08:22:25 PDT 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: c9b4dc3a81091856584747010881a816a4901b69
      https://github.com/llvm/llvm-project/commit/c9b4dc3a81091856584747010881a816a4901b69
  Author: Momchil Velikov <momchil.velikov at arm.com>
  Date:   2022-10-28 (Fri, 28 Oct 2022)

  Changed paths:
    M llvm/include/llvm/Transforms/Utils/SCCPSolver.h
    M llvm/lib/Transforms/IPO/FunctionSpecialization.cpp
    M llvm/lib/Transforms/IPO/SCCP.cpp
    M llvm/lib/Transforms/Utils/SCCPSolver.cpp

  Log Message:
  -----------
  [FuncSpec][NFC] Avoid redundant computations of DominatorTree/LoopInfo

The `FunctionSpecialization` pass needs loop analysis results for its
cost function. For this purpose, it computes the `DominatorTree` and
`LoopInfo` for a function in `getSpecializationBonus`.  This function,
however, is called O(number of call sites x number of arguments), but
the DominatorTree/LoopInfo can be computed just once.

This patch plugs into the PassManager infrastructure to obtain
LoopInfo for a function and removes ad-hoc computation from
`getSpecializatioBonus`.

Reviewed By: ChuanqiXu, labrinea

Differential Revision: https://reviews.llvm.org/D136332




More information about the All-commits mailing list