[PATCH] D152399: [CodeGen] Fine tune MachineFunctionSplitPass (MFS) for FSAFDO.

Hongtao Yu via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jun 26 16:00:31 PDT 2023


hoy added inline comments.


================
Comment at: llvm/lib/CodeGen/MachineFunctionSplitter.cpp:118
 
   if (PercentileCutoff > 0) {
     return PSI->isColdCountNthPercentile(PercentileCutoff, *Count);
----------------
shenhan wrote:
> hoy wrote:
> > Looks like this is the logic the `HasAccurateSampleProfile` check is bypassing. Is the `PercentileCutoff` count is too high in your case? IIUC, you want more blocks to be treated as cold to lower the splitting cost. A higher cutoff count should help. Am I missing anything?
> > 
> > BTW, a more accurate profile should be more trustful, and thus the existing logic should work better. The term `HasAccurateSampleProfile` to bypass the existing logic here is a bit confusing to me.
> Yes, you are right. Sorry, this is a bit confusing. The origin name was IsUsingFSAFDO, and was later renamed to HasAccurateSampleProfile per reviewer's suggestion. And it should equal to the negated value of IsUsingFSAFDO.
> 
> So replaced HasAccurateProfile with !HasAccurateProfile and negated the initial value of HasAccurateProfile and updated the comment.
Thanks for the clarification. Another question, is it intentional to always bypass `PercentileCutoff` and use `ColdCountThreshold`  instead for FS-AFDO?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D152399



More information about the llvm-commits mailing list