]> git.ipfire.org Git - thirdparty/gcc.git/commit
Improve costing of speculative calls in ipa-fnsummary
authorJan Hubicka <jh@suse.cz>
Fri, 19 Sep 2025 17:09:00 +0000 (19:09 +0200)
committerJan Hubicka <jh@suse.cz>
Fri, 19 Sep 2025 17:09:00 +0000 (19:09 +0200)
commit310c9a3842d4a9b5cfc884c1669b146c84d19926
treee9b0c0ffe21a8459c43d13825a492937a5175eb6
parentad3fb999a1b56893f0f6296a52fe2af550763fee
Improve costing of speculative calls in ipa-fnsummary

This patch implements logic to estimate_edge_devirt_benefit to not account call
statement sizes of speculative calls in case we know the call we be turned to
direct call by inlining.  I also noticed that estimate_edge_size_and_time fails
to accont code size savings by devirtualization when not asked to compute hints
(this is quite rare; only early inliner and inlining functions called once is
affected) and compensated for that in estimate_calls_size_and_time

gcc/ChangeLog:

* ipa-fnsummary.cc (estimate_edge_devirt_benefit): Handle speculative
edges correctly.
(estimate_edge_size_and_time): Even when not collecting hints,
devirtualization affects function size.
(estimate_calls_size_and_time): Do not use tables when devirtualization
is possible.
gcc/ipa-fnsummary.cc