diff mbox series

Do not read function bodies to merge zero profiles

Message ID 20181215210545.el4ccpj3gxlbhxq3@kam.mff.cuni.cz
State New
Headers show
Series Do not read function bodies to merge zero profiles | expand

Commit Message

Jan Hubicka Dec. 15, 2018, 9:05 p.m. UTC
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.
diff mbox series

Patch

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