This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Do not read function bodies to merge zero profiles
- From: Jan Hubicka <hubicka at ucw dot cz>
- To: gcc-patches at gcc dot gnu dot org
- Date: Sat, 15 Dec 2018 22:05:45 +0100
- Subject: Do not read function bodies to merge zero profiles
Hi,
this patch saves some stream-in time of WPA becuase if source profile is
zero, there is no need to merge it into destination since it is no-op
anyway.
Bootstrapped/regtested x86_64-linux, comitted.
Honza
* ipa-utils.c (ipa_merge_profiles): Do no merging when source function
has zero count.
Index: ipa-utils.c
===================================================================
--- ipa-utils.c (revision 267122)
+++ ipa-utils.c (working copy)
@@ -402,6 +402,10 @@ ipa_merge_profiles (struct cgraph_node *
if (src->profile_id && !dst->profile_id)
dst->profile_id = src->profile_id;
+ /* Merging zero profile to dst is no-op. */
+ if (src->count.ipa () == profile_count::zero ())
+ return;
+
/* FIXME when we merge in unknown profile, we ought to set counts as
unsafe. */
if (!src->count.initialized_p ()