]> git.ipfire.org Git - thirdparty/gcc.git/commit
Make inliner more careful about profile inconsistencies
authorJan Hubicka <jh@suse.cz>
Sun, 21 Sep 2025 10:28:17 +0000 (12:28 +0200)
committerJan Hubicka <jh@suse.cz>
Sun, 21 Sep 2025 10:28:45 +0000 (12:28 +0200)
commitc4bf7dcade38cb13b7d00a8169227a4ba1991b1f
tree847e3a25c08059644779e85d526744ad5635d373
parent749af11149623dbf9ba026fd98bd7f31409fdaed
Make inliner more careful about profile inconsistencies

This patch makes inliner to not subtract inlined function profile from the
offline copy in cases where profile is clearly not consistent.  As a result we
do not drop the offline version to likely never executed profile.  This helps
in cases the profile got lost, i.e. by comdat function merging and also for
auto-fdo.

gcc/ChangeLog:

* ipa-inline-transform.cc (clone_inlined_nodes): Add KEEP_OFFLINE_COPY
parameter.
(inline_call): Sanity check profile and if it is clearly broken do
not subtract profile from original function.
* ipa-inline.cc (recursive_inlining): Update.
* ipa-inline.h (clone_inlined_nodes): Update.
gcc/ipa-inline-transform.cc
gcc/ipa-inline.cc
gcc/ipa-inline.h