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

Wenlei He via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 13 18:39:40 PDT 2023


wenlei added a comment.

In D152399#4498827 <https://reviews.llvm.org/D152399#4498827>, @xur wrote:

> It seems that we now need to specify "-mllvm -mfs-psi-cutoff=0" to enable the MFS for FSAFDO, if we want to get the same optimization behavior.  This is not good for usage adoption. 
> I think if the users want to enable MFS in FSAFDO, they should only need to add -fsplit-machine-functions. They should not need to use ANY extra internal options.

Curious what happens if mfs is turned on for FSAFDO without `-mfs-psi-cutoff=0`? Does it actually cause regression just because different threshold is used from `PSI->isColdCountNthPercentile(PercentileCutoff, *Count)`?

> I know the newer change was to unify the heuristic code in isColdBlock. But I don't like the change here.
>
> I would propose to replace  HasAccurateProfile parameter in isColdBlock with an enum of profileKind (InstruProfile, Sample Profile, or Sample Profile with FSAFDO etc). And we can have different heuristic for different profile kind.

Yes, querying PSI directly is better.


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