[all-commits] [llvm/llvm-project] 80155c: [Analysis] Refactor MBB hotness/coldness into temp...

Han Shen via All-commits all-commits at lists.llvm.org
Wed Jun 28 22:34:26 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 80155cbf0be1744953edf68b9729c24bd0de79c4
      https://github.com/llvm/llvm-project/commit/80155cbf0be1744953edf68b9729c24bd0de79c4
  Author: Han Shen <shenhan at google.com>
  Date:   2023-06-28 (Wed, 28 Jun 2023)

  Changed paths:
    M llvm/include/llvm/Analysis/ProfileSummaryInfo.h
    M llvm/include/llvm/Transforms/Utils/SizeOpts.h
    M llvm/lib/Analysis/ProfileSummaryInfo.cpp
    M llvm/lib/CodeGen/MachineFunction.cpp
    M llvm/lib/CodeGen/MachineSizeOpts.cpp
    M llvm/lib/Transforms/Utils/SizeOpts.cpp

  Log Message:
  -----------
  [Analysis] Refactor MBB hotness/coldness into templated PSI functions.

Currently, to use PSI->isFunctionHotInCallGraph, we first need to
calculate BPI->BFI, which is expensive. Instead, we can implement this
directly with MBFI. Also as @wenlei mentioned in another patch review,
that MachineSizeOpts already has isFunctionColdInCallGraph,
isFunctionHotInCallGraphNthPercentile, etc implemented. These can be
refactored and so they can be reused across MachineFunctionSplitting
and MachineSizeOpts passes.

This CL does this - it refactors out those internal static functions
into PSI as templated functions, so they can be accessed easily.

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




More information about the All-commits mailing list