Hi,
this patch fixes the way we account time.  analyze_function_body
uses frequency of BB execution and expected time to execute the stmt
to compute overall time it takes to invoke function, but it manages to
account time which is not scaled by frequency, yet.

Bootstrapped/regtested x86_64-linux, comitted.

2019-01-05  Jan Hubicka  <hubi...@ucw.cz>

        * ipa-fnsummary.c (analyze_function_body): Fix accounting of time.

Index: ipa-fnsummary.c
===================================================================
--- ipa-fnsummary.c     (revision 267585)
+++ ipa-fnsummary.c     (working copy)
@@ -2234,12 +2234,12 @@ analyze_function_body (struct cgraph_nod
                    {
                      predicate ip = bb_predicate & predicate::not_inlined ();
                      info->account_size_time (this_size * prob,
-                                              (this_time * prob) / 2, ip,
+                                              (final_time * prob) / 2, ip,
                                               p);
                    }
                  if (prob != 2)
                    info->account_size_time (this_size * (2 - prob),
-                                            (this_time * (2 - prob) / 2),
+                                            (final_time * (2 - prob) / 2),
                                             bb_predicate,
                                             p);
                }

Reply via email to