diff mbox series

Fix accounting of time in ipa-fnsummary

Message ID 20190105174918.7lphr5vv6szkguxo@kam.mff.cuni.cz
State New
Headers show
Series Fix accounting of time in ipa-fnsummary | expand

Commit Message

Jan Hubicka Jan. 5, 2019, 5:49 p.m. UTC
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  <hubicka@ucw.cz>

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

Patch

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);
 		}