[all-commits] [llvm/llvm-project] 4d8cf2: Resubmit with fix: [NFC] Refactor MBB hotness/cold...

Han Shen via All-commits all-commits at lists.llvm.org
Tue Jun 27 22:03:29 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 4d8cf2ae6804e0d3f2b668dbec0f5c1983358328
      https://github.com/llvm/llvm-project/commit/4d8cf2ae6804e0d3f2b668dbec0f5c1983358328
  Author: Han Shen <shenhan at google.com>
  Date:   2023-06-27 (Tue, 27 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/MachineSizeOpts.cpp
    M llvm/lib/Transforms/Utils/SizeOpts.cpp

  Log Message:
  -----------
  Resubmit with fix: [NFC] Refactor MBB hotness/coldness into templated PSI functions.

In D152399, we calculate BPI->BFI in MachineFunctionSplit pass just to
use PSI->isFunctionHotInCallGraph, which is expensive. Instead, we can
implement this directly with MBFI.

Reviewer mentioned in the comment, that machine_size_opts already has
isFunctionColdInCallGraph, isFunctionHotInCallGraphNthPercentile, etc
implemented. These can be refactored and reused across MFS and machine
size opts.

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