ipa-cp.c (ipcp_lattice<valtype>::print): Update dumping.
authorJan Hubicka <hubicka@ucw.cz>
Sat, 2 Dec 2017 09:48:24 +0000 (10:48 +0100)
committerJan Hubicka <hubicka@gcc.gnu.org>
Sat, 2 Dec 2017 09:48:24 +0000 (09:48 +0000)
* ipa-cp.c (ipcp_lattice<valtype>::print): Update dumping.
(update_specialized_profile): Fix updating of counts.
(perhaps_add_new_callers): Likewise.

From-SVN: r255358

gcc/ChangeLog
gcc/ipa-cp.c

index 8bbf08098f7a254eb01ea065c0ba8eb420073b1c..367dcb14828a977cbfc5d3566597c927328cc0af 100644 (file)
@@ -1,3 +1,9 @@
+2017-12-01  Jan Hubicka  <hubicka@ucw.cz>
+
+       * ipa-cp.c (ipcp_lattice<valtype>::print): Update dumping.
+       (update_specialized_profile): Fix updating of counts.
+       (perhaps_add_new_callers): Likewise.
+
 2017-12-01  Jan Hubicka  <hubicka@ucw.cz>
 
        PR target/81616
index 144762cf5e25a3a66c6fd09cbe1840321ae63a7f..b6b1fefe9bc549ae79e9fa2b3dcb944952cae283 100644 (file)
@@ -497,8 +497,8 @@ ipcp_lattice<valtype>::print (FILE * f, bool dump_sources, bool dump_benefits)
 
          fprintf (f, " [from:");
          for (s = val->sources; s; s = s->next)
-           fprintf (f, " %i(%i)", s->cs->caller->order,
-                    s->cs->frequency ());
+           fprintf (f, " %i(%f)", s->cs->caller->order,
+                    s->cs->sreal_frequency ().to_double ());
          fprintf (f, "]");
        }
 
@@ -3751,10 +3751,7 @@ update_specialized_profile (struct cgraph_node *new_node,
   orig_node->count -= redirected_sum;
 
   for (cs = new_node->callees; cs; cs = cs->next_callee)
-    if (cs->frequency ())
-      cs->count += cs->count.apply_scale (redirected_sum, new_node_count);
-    else
-      cs->count = profile_count::zero ();
+    cs->count += cs->count.apply_scale (redirected_sum, new_node_count);
 
   for (cs = orig_node->callees; cs; cs = cs->next_callee)
     {
@@ -4482,7 +4479,7 @@ perhaps_add_new_callers (cgraph_node *node, ipcp_value<valtype> *val)
        }
     }
 
-  if (redirected_sum > profile_count::zero ())
+  if (redirected_sum.nonzero_p ())
     update_specialized_profile (val->spec_node, node, redirected_sum);
 }