]> git.ipfire.org Git - thirdparty/gcc.git/commit
Fix handling of GUESSED_LOCAL in auto-fdo and preserve more static profile
authorJan Hubicka <hubicka@ucw.cz>
Thu, 5 Jun 2025 13:24:36 +0000 (15:24 +0200)
committerJan Hubicka <hubicka@ucw.cz>
Thu, 5 Jun 2025 13:24:36 +0000 (15:24 +0200)
commit9399a3b5f512af6dbbe05be076e726efc91413f1
tree26e10fab99fbe864def0817dee0c944249999de4
parent8cf31de8c8fec295c5f627b399d9e015df266297
Fix handling of GUESSED_LOCAL in auto-fdo and preserve more static profile

This patch fixes ICE where GUESSED_LOCAL was kept in autofdo profile.
It may make more sense to turn GESSED_LOCAL 0 to GUESSED 0 since it seems
bit more informative then autofdo 0 (which really means that count is below
the 2% threshold or that info was lost due to some code transformation).

The patch also modifies code setting probabilities of edge to keep reliable
predictions of 0 or 1.

gcc/ChangeLog:

* auto-profile.cc (update_count_by_afdo_count): Fix handling
of GUESSED_LOCAL.
(afdo_calculate_branch_prob): Preserve static profile for
probabilities 0 and 1.
gcc/auto-profile.cc