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

Rong Xu via llvm-commits llvm-commits at lists.llvm.org
Fri Jul 14 09:39:38 PDT 2023


On Thu, Jul 13, 2023 at 6:39 PM Wenlei He via Phabricator <
reviews at reviews.llvm.org> wrote:

> 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)`?
>

Using "cold" from PSI is not achieving the same performance as using the
"cold" in this file. We tried PSI cold in the very beginning and quickly
realized we needed another threshold for MFS.



>
> > 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
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230714/c973f2b0/attachment.html>


More information about the llvm-commits mailing list