[PATCH] D152758: [NFC] Refact MBB hotness/coldness into MBFI.

Han Shen via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jun 12 16:40:33 PDT 2023


shenhan created this revision.
shenhan added reviewers: wenlei, xur, hjyamauchi.
Herald added a subscriber: hiraditya.
Herald added a project: All.
shenhan requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

[NFC] In D152399 <https://reviews.llvm.org/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 @wenlei mentioned in his commet, 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 MachineBlockFrequencyInfo as member functions, so they can be accessed easily.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D152758

Files:
  llvm/include/llvm/CodeGen/MachineBlockFrequencyInfo.h
  llvm/lib/CodeGen/MachineBlockFrequencyInfo.cpp
  llvm/lib/CodeGen/MachineSizeOpts.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D152758.530703.patch
Type: text/x-patch
Size: 14942 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230612/8fc8739c/attachment.bin>


More information about the llvm-commits mailing list