Commit ffb77fd6 by Jan Hubicka Committed by Jan Hubicka

ipa-cp.c (estimate_local_effects): Convert sreal to int.

	* ipa-cp.c (estimate_local_effects): Convert sreal to int.
	* ipa-inline-analysis.c (MAX_TIME): Remove.
	(account_size_time): Use sreal for time.
	(dump_inline_summary): Update.
	(estimate_function_body_sizes): Update.
	(estimate_edge_size_and_time): Update.
	(estimate_calls_size_and_time): Update.
	(estimate_node_size_and_time): Update.
	(inline_merge_summary): Update.
	(inline_update_overall_summary): Update.
	(estimate_time_after_inlining): Update.
	(inline_read_section): Update.
	(inline_write_summary): Update.
	* ipa-inline.c (compute_uninlined_call_time): Update.
	(compute_inlined_call_time): Update.
	(recursive_inlining): Update.
	(inline_small_functions): Update.
	(dump_overall_stats): Update.
	* ipa-inline.h: Include sreal.h.
	(size_time_entry): Turn time to sreal.
	(inline_summary): Turn self_time nad time to sreal.

From-SVN: r247277
parent 8a267096
2017-04-25 Jan Hubicka <hubicka@ucw.cz>
* ipa-cp.c (estimate_local_effects): Convert sreal to int.
* ipa-inline-analysis.c (MAX_TIME): Remove.
(account_size_time): Use sreal for time.
(dump_inline_summary): Update.
(estimate_function_body_sizes): Update.
(estimate_edge_size_and_time): Update.
(estimate_calls_size_and_time): Update.
(estimate_node_size_and_time): Update.
(inline_merge_summary): Update.
(inline_update_overall_summary): Update.
(estimate_time_after_inlining): Update.
(inline_read_section): Update.
(inline_write_summary): Update.
* ipa-inline.c (compute_uninlined_call_time): Update.
(compute_inlined_call_time): Update.
(recursive_inlining): Update.
(inline_small_functions): Update.
(dump_overall_stats): Update.
* ipa-inline.h: Include sreal.h.
(size_time_entry): Turn time to sreal.
(inline_summary): Turn self_time nad time to sreal.
2017-04-25 Jan Hubicka <hubicka@ucw.cz>
* sreal.c: Include backend.h, tree.h, gimple.h, cgraph.h and
data-streamer.h
(sreal::stream_out, sreal::stream_in): New.
......
......@@ -2832,7 +2832,7 @@ estimate_local_effects (struct cgraph_node *node)
vec<ipa_agg_jump_function> known_aggs;
vec<ipa_agg_jump_function_p> known_aggs_ptrs;
bool always_const;
int base_time = inline_summaries->get (node)->time;
int base_time = inline_summaries->get (node)->time.to_int ();
int removable_params_cost;
if (!count || !ipcp_versionable_function_p (node))
......
......@@ -654,7 +654,7 @@ compute_uninlined_call_time (struct inline_summary *callee_info,
else
uninlined_call_time = uninlined_call_time >> 11;
int caller_time = inline_summaries->get (caller)->time;
sreal caller_time = inline_summaries->get (caller)->time;
return uninlined_call_time + caller_time;
}
......@@ -668,7 +668,7 @@ compute_inlined_call_time (struct cgraph_edge *edge,
cgraph_node *caller = (edge->caller->global.inlined_to
? edge->caller->global.inlined_to
: edge->caller);
int caller_time = inline_summaries->get (caller)->time;
sreal caller_time = inline_summaries->get (caller)->time;
sreal time = edge_time;
if (edge->count && caller->count)
......@@ -753,6 +753,14 @@ want_inline_small_function_p (struct cgraph_edge *e, bool report)
int growth = estimate_edge_growth (e);
inline_hints hints = estimate_edge_hints (e);
bool big_speedup = big_speedup_p (e);
/*
fprintf (stderr, "%i %i %i\n",growth,hints,big_speedup);
dump_inline_summary (stderr, e->caller->global.inlined_to ? e->caller->global.inlined_to : e->caller);
dump_inline_summary (stderr, e->callee);
sreal time = compute_uninlined_call_time (inline_summaries->get (e->callee),
e);
sreal inlined_time = compute_inlined_call_time (e, estimate_edge_time (e));
fprintf (stderr, "%f %f\n", time.to_double (), inlined_time.to_double ());*/
if (growth <= 0)
;
......@@ -1023,7 +1031,9 @@ edge_badness (struct cgraph_edge *edge, bool dump)
edge_time = estimate_edge_time (edge);
hints = estimate_edge_hints (edge);
gcc_checking_assert (edge_time >= 0);
gcc_checking_assert (edge_time <= callee_info->time);
/* FIXME: -1 to care of rounding issues should go away once cache is migrated.
to sreals. */
gcc_checking_assert (edge_time - 1 <= callee_info->time);
gcc_checking_assert (growth <= callee_info->size);
if (dump)
......@@ -1554,9 +1564,11 @@ recursive_inlining (struct cgraph_edge *edge,
if (dump_file)
fprintf (dump_file,
"\n Inlined %i times, "
"body grown from size %i to %i, time %i to %i\n", n,
inline_summaries->get (master_clone)->size, inline_summaries->get (node)->size,
inline_summaries->get (master_clone)->time, inline_summaries->get (node)->time);
"body grown from size %i to %i, time %f to %f\n", n,
inline_summaries->get (master_clone)->size,
inline_summaries->get (node)->size,
inline_summaries->get (master_clone)->time.to_double (),
inline_summaries->get (node)->time.to_double ());
/* Remove master clone we used for inlining. We rely that clones inlined
into master clone gets queued just before master clone so we don't
......@@ -2052,10 +2064,10 @@ inline_small_functions (void)
if (dump_file)
{
fprintf (dump_file,
" Inlined into %s which now has time %i and size %i, "
" Inlined into %s which now has time %f and size %i, "
"net change of %+i.\n",
edge->caller->name (),
inline_summaries->get (edge->caller)->time,
inline_summaries->get (edge->caller)->time.to_double (),
inline_summaries->get (edge->caller)->size,
overall_size - old_size);
}
......@@ -2245,7 +2257,7 @@ dump_overall_stats (void)
if (!node->global.inlined_to
&& !node->alias)
{
int time = inline_summaries->get (node)->time;
int time = inline_summaries->get (node)->time.to_double ();
sum += time;
sum_weighted += time * node->count;
}
......
......@@ -21,6 +21,8 @@ along with GCC; see the file COPYING3. If not see
#ifndef GCC_IPA_INLINE_H
#define GCC_IPA_INLINE_H
#include "sreal.h"
/* Representation of inline parameters that do depend on context function is
inlined into (i.e. known constant values of function parameters.
......@@ -109,7 +111,7 @@ struct GTY(()) size_time_entry
{
struct predicate predicate;
int size;
int time;
sreal GTY((skip)) time;
};
/* Function inlining information. */
......@@ -122,7 +124,7 @@ struct GTY(()) inline_summary
/* Size of the function body. */
int self_size;
/* Time of the function body. */
int self_time;
sreal GTY((skip)) self_time;
/* Minimal size increase after inlining. */
int min_size;
......@@ -146,7 +148,7 @@ struct GTY(()) inline_summary
/* Expected offset of the stack frame of inlined function. */
HOST_WIDE_INT stack_frame_offset;
/* Estimated size of the function after inlining. */
int time;
sreal GTY((skip)) time;
int size;
/* Conditional size/time information. The summaries are being
......
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