Jan Hubicka b0d50cbb42 Fix profile updating in ipa-cp
Bootstrapping with autoprofiledbootstrap, LTO and checking enables ICEs in WPA
because we end up mixing local and IPA count in
ipa-cp.cc:update_specialized_profile.  This is because of missing call to
profile_count::adjust_for_ipa_scaling.  While looking into that I however
noticed that the function forgets to update indirect call edges. This made me
to commonize same logic which currently exists in clone_inlined_nodes,
update_specialized_profile, update_profiling_info and
update_counts_for_self_gen_clones.

While testing it I noticed that we also ICE when linking with
-fdump-ipa-all-details-blocks since IPA and local counts are temporarily mixed
during IPA transformation stage, so I also added check to profile_count::dump
to not crash and added verifier to gimple_verify_flow_info.

Other problem I also noticed is that while profile updates done by inliner (via
cgraph_node::clone) are correctly using global0 profiles instead of erasing
profile completely when IPA counts drops to 0, the scaling in ipa-cp is not
doing that, so we lose info and possibly some code quality.  I will fix that
incrementally. Similarly ipa-split, when offlining region with 0 entry count
may re-do frequency propagation to get something useful.

gcc/ChangeLog:

	* cgraph.cc (cgraph_node::apply_scale): New member function.
	* cgraph.h (struct cgraph_node): declare.
	* ipa-cp.cc (update_counts_for_self_gen_clones):
	Use cgraph_node::apply_scale.
	(update_profiling_info): Do not overwrite local
	profile when dropping to 0 global profile.
	(update_specialized_profile): Likewise.
	* ipa-inline-transform.cc (update_noncloned_counts): Remove.
	(can_remove_node_now_p_1): Fix formating.
	(clone_inlined_nodes): Use cgraph_node::apply_scale.
	* profile-count.cc (profile_count::dump): Do not ICE
	when count is not compatible with entry block count.
	* tree-cfg.cc (gimple_verify_flow_info): Check
	compatibility of count and entry block count.
2025-06-09 16:47:54 +02:00
2025-06-03 00:18:06 +00:00
2025-05-24 00:17:55 +00:00
2025-05-28 00:18:43 +00:00
2025-06-09 16:47:54 +02:00
2025-04-02 00:18:25 +00:00
2025-06-03 00:18:06 +00:00
2025-01-02 11:59:57 +01:00
2025-05-23 00:17:35 +00:00
2025-04-11 00:17:32 +00:00
2025-01-02 11:59:57 +01:00
2025-05-17 00:17:29 +00:00
2025-01-02 11:59:57 +01:00
2025-05-28 00:18:43 +00:00
2025-06-07 00:19:12 +00:00
2025-06-08 00:16:33 +00:00
2025-06-08 00:16:33 +00:00
2025-06-07 00:19:12 +00:00
2025-04-01 00:19:09 +00:00
2025-05-14 00:18:21 +00:00
2025-05-10 00:17:59 +00:00
2025-01-02 11:59:57 +01:00
2025-05-10 00:17:59 +00:00
2025-04-10 00:18:06 +00:00
2025-05-03 00:18:18 +00:00
2025-01-02 11:59:57 +01:00
2025-05-10 00:17:59 +00:00
2025-03-07 00:17:19 +00:00
2025-05-24 00:17:55 +00:00
2025-05-29 00:18:19 +00:00

This directory contains the GNU Compiler Collection (GCC).

The GNU Compiler Collection is free software.  See the files whose
names start with COPYING for copying permission.  The manuals, and
some of the runtime libraries, are under different terms; see the
individual source files for details.

The directory INSTALL contains copies of the installation information
as HTML and plain text.  The source of this information is
gcc/doc/install.texi.  The installation information includes details
of what is included in the GCC sources and what files GCC installs.

See the file gcc/doc/gcc.texi (together with other files that it
includes) for usage and porting information.  An online readable
version of the manual is in the files gcc/doc/gcc.info*.

See http://gcc.gnu.org/bugs/ for how to report bugs usefully.

Copyright years on GCC source files may be listed using range
notation, e.g., 1987-2012, indicating that every year in the range,
inclusive, is a copyrightable year that could otherwise be listed
individually.
Description
No description provided
Readme 1.5 GiB
Languages
C++ 30.7%
C 30%
Ada 14.5%
D 6.1%
Go 5.7%
Other 12.5%