Commit 070e3489 by Jan Hubicka Committed by Jan Hubicka

Implement inline call summaries.

	* ipa-fnsummary.c (ipa_fn_summary::account_size_time): Add CALL
	parameter and update call_size_time_table.
	(ipa_fn_summary::max_size_time_table_size): New constant.
	(estimate_calls_size_and_time_1): Break out from ...
	(estimate_calls_size_and_time): ... here; implement summary production.
	(summarize_calls_size_and_time): New function.
	(ipa_call_context::estimate_size_and_time): Bypass
	estimate_calls_size_and_time for leaf functions.
	(ipa_update_overall_fn_summary): Likewise.
	* ipa-fnsummary.h (call_size_time_table): New.
	(ipa_fn_summary::account_size_time): Update prototype.

From-SVN: r278513
parent 73248b1d
2019-11-20 Jan Hubicka <jh@suse.cz>
* ipa-fnsummary.c (ipa_fn_summary::account_size_time): Add CALL
parameter and update call_size_time_table.
(ipa_fn_summary::max_size_time_table_size): New constant.
(estimate_calls_size_and_time_1): Break out from ...
(estimate_calls_size_and_time): ... here; implement summary production.
(summarize_calls_size_and_time): New function.
(ipa_call_context::estimate_size_and_time): Bypass
estimate_calls_size_and_time for leaf functions.
(ipa_update_overall_fn_summary): Likewise.
* ipa-fnsummary.h (call_size_time_table): New.
(ipa_fn_summary::account_size_time): Update prototype.
2019-11-20 Joseph Myers <joseph@codesourcery.com> 2019-11-20 Joseph Myers <joseph@codesourcery.com>
* doc/invoke.texi (-Wc11-c2x-compat): Document. * doc/invoke.texi (-Wc11-c2x-compat): Document.
...@@ -117,8 +117,8 @@ public: ...@@ -117,8 +117,8 @@ public:
inlinable (false), single_caller (false), inlinable (false), single_caller (false),
fp_expressions (false), estimated_stack_size (false), fp_expressions (false), estimated_stack_size (false),
time (0), conds (NULL), time (0), conds (NULL),
size_time_table (NULL), loop_iterations (NULL), loop_stride (NULL), size_time_table (NULL), call_size_time_table (NULL), loop_iterations (NULL),
growth (0), scc_no (0) loop_stride (NULL), growth (0), scc_no (0)
{ {
} }
...@@ -129,6 +129,7 @@ public: ...@@ -129,6 +129,7 @@ public:
fp_expressions (s.fp_expressions), fp_expressions (s.fp_expressions),
estimated_stack_size (s.estimated_stack_size), estimated_stack_size (s.estimated_stack_size),
time (s.time), conds (s.conds), size_time_table (s.size_time_table), time (s.time), conds (s.conds), size_time_table (s.size_time_table),
call_size_time_table (NULL),
loop_iterations (s.loop_iterations), loop_stride (s.loop_stride), loop_iterations (s.loop_iterations), loop_stride (s.loop_stride),
growth (s.growth), scc_no (s.scc_no) growth (s.growth), scc_no (s.scc_no)
{} {}
...@@ -161,7 +162,12 @@ public: ...@@ -161,7 +162,12 @@ public:
/* Conditional size/time information. The summaries are being /* Conditional size/time information. The summaries are being
merged during inlining. */ merged during inlining. */
conditions conds; conditions conds;
/* Normal code is acocunted in size_time_table, while calls are
accounted in call_size_time_table. This is because calls
are often adjusted by IPA optimizations and thus this summary
is generated from call summary information when needed. */
vec<size_time_entry, va_gc> *size_time_table; vec<size_time_entry, va_gc> *size_time_table;
vec<size_time_entry, va_gc> *call_size_time_table;
/* Predicate on when some loop in the function becomes to have known /* Predicate on when some loop in the function becomes to have known
bounds. */ bounds. */
...@@ -179,10 +185,13 @@ public: ...@@ -179,10 +185,13 @@ public:
int scc_no; int scc_no;
/* Record time and size under given predicates. */ /* Record time and size under given predicates. */
void account_size_time (int, sreal, const predicate &, const predicate &); void account_size_time (int, sreal, const predicate &, const predicate &,
bool call = false);
/* We keep values scaled up, so fractional sizes can be accounted. */ /* We keep values scaled up, so fractional sizes can be accounted. */
static const int size_scale = 2; static const int size_scale = 2;
/* Maximal size of size_time_table before we start to be conservative. */
static const int max_size_time_table_size = 256;
}; };
class GTY((user)) ipa_fn_summary_t: class GTY((user)) ipa_fn_summary_t:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment