]> git.ipfire.org Git - thirdparty/gcc.git/commit
Increase auto-fdo profile scaling
authorJan Hubicka <jh@suse.cz>
Sun, 21 Sep 2025 14:52:18 +0000 (16:52 +0200)
committerJan Hubicka <jh@suse.cz>
Sun, 21 Sep 2025 14:53:22 +0000 (16:53 +0200)
commit9766f99e6ea365c6ff2c4b1a27a8b9eddb323eb1
tree986bbeb64a480a611787362a3fb029a31bf1b604
parent0f28eb8ab909712aaf6517c0c818e5b36de32383
Increase auto-fdo profile scaling

Increase scaling factor for auto-fdo profiles.  I origianlly used
n_bits/2 which is also used by local guessing algorithm.  For local guessing
algorithm the main factor is to prevent inliner scaling up the profile till
overflow.

With sane IPA profile large scaling up should essentially never happen. Inliner and
ipa-cp only duplicates code and should only scale down. ipa-icf and tail merging merges
code but not very large number of code paths.
In practice scaling up still happens when profile is inconsisent, so this use
n_bits-10, which is 50 currently.  The main advantage of this is to reduce chances
things drop to 0 and we hit the various special cases for 0 auto-FDO profile.

gcc/ChangeLog:

* auto-profile.cc (autofdo_source_profile::read): Scale profile up to
profile_count::n_bits - 10.
gcc/auto-profile.cc