]> git.ipfire.org Git - thirdparty/gcc.git/commit
Enable ipa-cp cloning for cold wrappers of hot functions
authorJan Hubicka <hubicka@ucw.cz>
Thu, 3 Jul 2025 08:25:39 +0000 (10:25 +0200)
committerJan Hubicka <hubicka@ucw.cz>
Thu, 3 Jul 2025 08:25:39 +0000 (10:25 +0200)
commit328ef9aaede3c59224e52a1337416e5489e7c6c8
tree47fe5c9a6b202c36aaec82a03dbdb97c2910490b
parentbba817adbfde5c44fb77cc284c1917d33407ec2e
Enable ipa-cp cloning for cold wrappers of hot functions

ipa-cp cloning disables itself for all functions not passing opt_for_fn
(node->decl, optimize_size) which disables it for cold wrappers of hot
functions where we want to propagate.  Since we later want to time saved
to be considered hot, we do not need to make this early test.

The patch also fixes few other places where AFDO 0 disables ipa-cp.

gcc/ChangeLog:

* ipa-cp.cc (cs_interesting_for_ipcp_p): Handle
correctly GLOBAL0 afdo counts.
(ipcp_cloning_candidate_p): Do not rule out nodes
!node->optimize_for_size_p ().
(good_cloning_opportunity_p): Handle afdo counts
as non-zero.
gcc/ipa-cp.cc