Hello,

On Fri, Sep 04 2026, Martin Jambor wrote:
> Hi,
>
> With profile-feedback, the run-times used for opportunity evaluations
> is not currently scaled to the total measured run time of the
> program/compilation unit, which is an obvious mistake.  This patch
> adds such scaling by run-time which is however itself also scaled down
> so that the resulting scores rougly fall in line with the scores on
> hot loops we get using guessed profile.
>
> Kugan, please have a look if this helps addressing the issues you see
> with AutoFDO (though I have not looked at whether the default value of
> ipa-cp-profile-runtime-scaling is appropriate also for AutoFDO).
>
> I have bootstrapped and tested this on an x86_64-linux in a normal way
> and then also did a bootstrap with LTO, PGO and -O3 optimization level.
> OK for master?
>
> Martin
>
>
>
> gcc/ChangeLog:
>
> 2026-05-15  Martin Jambor  <[email protected]>
>
>       * ipa-cp.cc (overall_scaled_runtime): New.
>       (good_cloning_opportunity_p): Scale PGO evaluations by
>       overall_scaled_runtime.
>       (ipcp_propagate_stage): Calculate also overall_scaled_runtime and
>       print it and unscaled time.
>       (ipa_cp_cc_finalize): Set overall_scaled_runtime to zero.
>       * params.opt (ipa-cp-profile-runtime-scaling): New.
>       * doc/params.texi (ipa-cp-profile-runtime-scaling): New.

After this was approved by Honza in person, I have pushed this as commit
f9b60a8bd75.

Martin


Reply via email to