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

Rahman Lavaee via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Apr 6 23:26:15 PDT 2023


rahmanl added a comment.

Sorry for the delay.



================
Comment at: llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp:1934
       *MBBProfileDumpFileOutput.get()
-          << MF->getName() << "," << MBB.getNumber() << ","
+          << MF->getName() << "," << MBB.getBBID() << ","
           << MBFI.getBlockFreqRelativeToEntryBlock(&MBB) << "\n";
----------------
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`.


================
Comment at: llvm/test/CodeGen/MLRegalloc/bb-profile-dump.ll:6
 ;
-; RUN: llc -mtriple=x86_64-linux-unknown -o /dev/null -mbb-profile-dump=- %s | FileCheck %s
+; RUN: llc -mtriple=x86_64-linux-unknown -o /dev/null -basic-block-sections=list -mbb-profile-dump=- %s | FileCheck %s
 
----------------
It's interesting that this works. Maybe just use `-basic-block-sections=labels` to be safe.


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