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

Han Shen via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jun 13 18:44:58 PDT 2023


shenhan added a comment.

In D152758#4416070 <https://reviews.llvm.org/D152758#4416070>, @wenlei wrote:

> Thanks for the follow up. It doesn't feel like this belongs to MBFI either. BFI for IR doesn't contain any of the hotness query - instead these are all part of PSI.
>
> I'm wondering if we can make some template functions in PSI that cover both IR and MIR hotness queries, since BFI and MBFI have very similar APIs. We have precedence for PGO code sharing between IR and MIR (`SampleProfileLoaderBaseImpl<BT>`).

Thanks. That makes  sense. I've reverted all changes to MBFI. And moved the code to PSI with templates to accommodate Function/MachineFunction, BasicBlock/MachineBasicBlock, BFI/MBFI. Also moved some function implementations from the cpp file to the header, as they are templated. (I have not chosen to template the whole PSI class, because currently I see limited usage for such changes. (And the scope of template-PSI would require a serials of CLs.)).


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D152758/new/

https://reviews.llvm.org/D152758



More information about the llvm-commits mailing list