ipa-utils.c (ipa_merge_profiles): Do no merging when source function has zero count.
authorJan Hubicka <hubicka@ucw.cz>
Sat, 15 Dec 2018 21:04:29 +0000 (22:04 +0100)
committerJan Hubicka <hubicka@gcc.gnu.org>
Sat, 15 Dec 2018 21:04:29 +0000 (21:04 +0000)
* ipa-utils.c (ipa_merge_profiles): Do no merging when source function
has zero count.

From-SVN: r267174

gcc/ChangeLog
gcc/ipa-utils.c

index f829e93cd499730b910ef3956e1aef938cc8c6a6..fd92845039ef53f8244e0e0f60aa021c745fb121 100644 (file)
@@ -1,3 +1,8 @@
+2018-12-15  Jan Hubicka  <hubicka@ucw.cz>
+
+       * ipa-utils.c (ipa_merge_profiles): Do no merging when source function
+       has zero count.
+
 2018-12-15  Jakub Jelinek  <jakub@redhat.com>
 
        PR tree-optimization/88464
index 9985721f7da795e052f283b3c5ed6430cf9d4a88..3345f9dee9fbf227e4526acd52fb04239603182e 100644 (file)
@@ -402,6 +402,10 @@ ipa_merge_profiles (struct cgraph_node *dst,
   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 ()