summaryrefslogtreecommitdiff
path: root/gcc/ipa-inline.c
diff options
context:
space:
mode:
authorhubicka <hubicka@138bc75d-0d04-0410-961f-82ee72b054a4>2017-04-28 13:04:48 +0000
committerhubicka <hubicka@138bc75d-0d04-0410-961f-82ee72b054a4>2017-04-28 13:04:48 +0000
commit2e2119864c44a65f4e2ea7b26dc87f546e9e872d (patch)
tree605e718598b0f75578b041856d9df7946d8b7787 /gcc/ipa-inline.c
parent2af29974ca0e61aa19f14d5f19a1b2c7d8794c4f (diff)
downloadgcc-2e2119864c44a65f4e2ea7b26dc87f546e9e872d.tar.gz
* ipa-cp.c (perform_estimation_of_a_value): Turn time to sreal.
(estimate_local_effects): Likewise. * ipa-inline.c (compute_inlined_call_time, want_inline_small_function_p, edge_badness, inline_small_functions, dump_overall_stats): LIkewise. * ipa-inline.h (edge_growth_cache_entry, estimate_time_after_inlining, estimate_ipcp_clone_size_and_time, do_estimate_edge_time, do_estimate_edge_time, estimate_edge_time): Likewise. * ipa-inline-analysis.c (estimate_node_size_and_time, estimate_ipcp_clone_size_and_time, do_estimate_edge_time): Likewise. (estimate_time_after_inlining): Remove. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@247380 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/ipa-inline.c')
-rw-r--r--gcc/ipa-inline.c30
1 files changed, 11 insertions, 19 deletions
diff --git a/gcc/ipa-inline.c b/gcc/ipa-inline.c
index f50d29b6a5d..2bbe46a97d2 100644
--- a/gcc/ipa-inline.c
+++ b/gcc/ipa-inline.c
@@ -663,13 +663,12 @@ compute_uninlined_call_time (struct inline_summary *callee_info,
inline sreal
compute_inlined_call_time (struct cgraph_edge *edge,
- int edge_time)
+ sreal time)
{
cgraph_node *caller = (edge->caller->global.inlined_to
? edge->caller->global.inlined_to
: edge->caller);
sreal caller_time = inline_summaries->get (caller)->time;
- sreal time = edge_time;
if (edge->count && caller->count)
time *= (sreal)edge->count / caller->count;
@@ -753,14 +752,6 @@ 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)
;
@@ -1019,7 +1010,8 @@ static sreal
edge_badness (struct cgraph_edge *edge, bool dump)
{
sreal badness;
- int growth, edge_time;
+ int growth;
+ sreal edge_time;
struct cgraph_node *callee = edge->callee->ultimate_alias_target ();
struct inline_summary *callee_info = inline_summaries->get (callee);
inline_hints hints;
@@ -1033,7 +1025,7 @@ edge_badness (struct cgraph_edge *edge, bool dump)
gcc_checking_assert (edge_time >= 0);
/* 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 (edge_time <= callee_info->time);
gcc_checking_assert (growth <= callee_info->size);
if (dump)
@@ -1043,9 +1035,9 @@ edge_badness (struct cgraph_edge *edge, bool dump)
edge->caller->order,
xstrdup_for_dump (callee->name ()),
edge->callee->order);
- fprintf (dump_file, " size growth %i, time %i ",
+ fprintf (dump_file, " size growth %i, time %f ",
growth,
- edge_time);
+ edge_time.to_double ());
dump_inline_hints (dump_file, hints);
if (big_speedup_p (edge))
fprintf (dump_file, " big_speedup");
@@ -1883,7 +1875,7 @@ inline_small_functions (void)
sreal cached_badness = edge_badness (edge, false);
int old_size_est = estimate_edge_size (edge);
- int old_time_est = estimate_edge_time (edge);
+ sreal old_time_est = estimate_edge_time (edge);
int old_hints_est = estimate_edge_hints (edge);
reset_edge_growth_cache (edge);
@@ -2250,20 +2242,20 @@ inline_to_all_callers (struct cgraph_node *node, void *data)
static void
dump_overall_stats (void)
{
- int64_t sum_weighted = 0, sum = 0;
+ sreal sum_weighted = 0, sum = 0;
struct cgraph_node *node;
FOR_EACH_DEFINED_FUNCTION (node)
if (!node->global.inlined_to
&& !node->alias)
{
- int time = inline_summaries->get (node)->time.to_double ();
+ sreal time = inline_summaries->get (node)->time;
sum += time;
sum_weighted += time * node->count;
}
fprintf (dump_file, "Overall time estimate: "
- "%" PRId64" weighted by profile: "
- "%" PRId64"\n", sum, sum_weighted);
+ "%f weighted by profile: "
+ "%f\n", sum.to_double (), sum_weighted.to_double ());
}
/* Output some useful stats about inlining. */