[PATCH] D147366: [MLGO] Change MBB Profile Dump from using MBB numbers to MBB IDs

Aiden Grossman via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Apr 7 00:04:14 PDT 2023


aidengrossman added a comment.

All good on the timing. Thanks for the review!



================
Comment at: llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp:1934
       *MBBProfileDumpFileOutput.get()
-          << MF->getName() << "," << MBB.getNumber() << ","
+          << MF->getName() << "," << MBB.getBBID() << ","
           << MBFI.getBlockFreqRelativeToEntryBlock(&MBB) << "\n";
----------------
rahmanl wrote:
> Currently, these IDs are only generated with `-basic-block-sections=labels|list`, but IIUC `-mbb-profile-dump` does not require these flags. We can either have these IDs always generated, or add sanity checks to make sure `-mbb-profile-dump` is always used with `-basic-block-sections`.
We are requiring `-basic-block-sections=labels` according to the help string, but we aren't checking if both are enabled at the same time. I've added a check (and test) to ensure that the `MachineFunction` we're going over has BB labels. The check emits an error otherwise.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D147366



More information about the llvm-commits mailing list