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 ()