]> git.ipfire.org Git - thirdparty/gcc.git/commit
Re-add logic to mitigate some afdo profile inconsistencies
authorJan Hubicka <hubicka@ucw.cz>
Mon, 30 Jun 2025 07:14:46 +0000 (09:14 +0200)
committerJan Hubicka <hubicka@ucw.cz>
Mon, 30 Jun 2025 07:15:14 +0000 (09:15 +0200)
commitf0b3c57ea6b87f51eb0a9bfd7c4438625cb7ed17
treeca5e0a9955eace42ab780f284dcb13b905f18ee6
parent483acdc188012cf5b1fc14a82402764c920470aa
Re-add logic to mitigate some afdo profile inconsistencies

This patch re-adds logic to increase counts of annotated basic blocks if otherwise
the Kirhoff law can not be solved.  This is done only in easy cases where total
count of in or out edges is smaller than the count of BB or when BB has single
exit which is annotated by small count.

This helps to solve problems seen i.e. in parest where header of loops gets too
low count because vectorizer replaced the IV condiitonal and did not preserved
debug info.  We should solve the debug info issues as well, and simiar problems
can now be tracked by in afdo debug dumps.

gcc/ChangeLog:

* auto-profile.cc (autofdo_source_profile::offline_external_functions):
Add missing newline in dump.
(afdo_propagate_edge): If annotated BB or edge has too small count
bump it up to mitigate profile imprecisions caused by vectorizer.
(afdo_propagate): Increase number of iteraitons and fix dump
gcc/auto-profile.cc