aboutsummaryrefslogtreecommitdiff
path: root/gcc/ipa-cp.c
diff options
context:
space:
mode:
authorJan Hubicka <hubicka@ucw.cz>2017-04-28 15:04:48 +0200
committerJan Hubicka <hubicka@gcc.gnu.org>2017-04-28 13:04:48 +0000
commitab38481ceff08c995ade3e88eccee6ab92914a44 (patch)
tree605e718598b0f75578b041856d9df7946d8b7787 /gcc/ipa-cp.c
parentb26f45f0694604745bbb3d269cacecefd28b4faf (diff)
downloadgcc-ab38481ceff08c995ade3e88eccee6ab92914a44.zip
gcc-ab38481ceff08c995ade3e88eccee6ab92914a44.tar.gz
gcc-ab38481ceff08c995ade3e88eccee6ab92914a44.tar.bz2
ipa-cp.c (perform_estimation_of_a_value): Turn time to sreal.
* 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. From-SVN: r247380
Diffstat (limited to 'gcc/ipa-cp.c')
-rw-r--r--gcc/ipa-cp.c23
1 files changed, 14 insertions, 9 deletions
diff --git a/gcc/ipa-cp.c b/gcc/ipa-cp.c
index d31e2c3..26ae8fc 100644
--- a/gcc/ipa-cp.c
+++ b/gcc/ipa-cp.c
@@ -2792,16 +2792,20 @@ static void
perform_estimation_of_a_value (cgraph_node *node, vec<tree> known_csts,
vec<ipa_polymorphic_call_context> known_contexts,
vec<ipa_agg_jump_function_p> known_aggs_ptrs,
- int base_time, int removable_params_cost,
+ sreal base_time, int removable_params_cost,
int est_move_cost, ipcp_value_base *val)
{
- int time, size, time_benefit;
+ int size, time_benefit;
+ sreal time;
inline_hints hints;
estimate_ipcp_clone_size_and_time (node, known_csts, known_contexts,
known_aggs_ptrs, &size, &time,
&hints);
- time_benefit = base_time - time
+ base_time -= time;
+ if (base_time > 65535)
+ base_time = 65535;
+ time_benefit = base_time.to_int ()
+ devirtualization_time_bonus (node, known_csts, known_contexts,
known_aggs_ptrs)
+ hint_time_bonus (hints)
@@ -2832,15 +2836,15 @@ 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.to_int ();
+ sreal base_time = inline_summaries->get (node)->time.to_int ();
int removable_params_cost;
if (!count || !ipcp_versionable_function_p (node))
return;
if (dump_file && (dump_flags & TDF_DETAILS))
- fprintf (dump_file, "\nEstimating effects for %s/%i, base_time: %i.\n",
- node->name (), node->order, base_time);
+ fprintf (dump_file, "\nEstimating effects for %s/%i, base_time: %f.\n",
+ node->name (), node->order, base_time.to_double ());
always_const = gather_context_independent_values (info, &known_csts,
&known_contexts, &known_aggs,
@@ -2853,7 +2857,8 @@ estimate_local_effects (struct cgraph_node *node)
{
struct caller_statistics stats;
inline_hints hints;
- int time, size;
+ sreal time;
+ int size;
init_caller_stats (&stats);
node->call_for_symbol_thunks_and_aliases (gather_caller_stats, &stats,
@@ -2867,7 +2872,7 @@ estimate_local_effects (struct cgraph_node *node)
if (dump_file)
fprintf (dump_file, " - context independent values, size: %i, "
- "time_benefit: %i\n", size, base_time - time);
+ "time_benefit: %f\n", size, (base_time - time).to_double ());
if (size <= 0 || node->local.local)
{
@@ -2878,7 +2883,7 @@ estimate_local_effects (struct cgraph_node *node)
fprintf (dump_file, " Decided to specialize for all "
"known contexts, code not going to grow.\n");
}
- else if (good_cloning_opportunity_p (node, base_time - time,
+ else if (good_cloning_opportunity_p (node, (base_time - time).to_int (),
stats.freq_sum, stats.count_sum,
size))
{