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,
- sreal base_time, int removable_params_cost,
+ int removable_params_cost,
int est_move_cost, ipcp_value_base *val)
{
int size, time_benefit;
- sreal time;
+ sreal time, base_time;
inline_hints hints;
estimate_ipcp_clone_size_and_time (node, known_csts, known_contexts,
known_aggs_ptrs, &size, &time,
- &hints);
+ &base_time, &hints);
base_time -= time;
if (base_time > 65535)
base_time = 65535;
vec<ipa_agg_jump_function> known_aggs;
vec<ipa_agg_jump_function_p> known_aggs_ptrs;
bool always_const;
- 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: %f.\n",
- node->name (), node->order, base_time.to_double ());
+ fprintf (dump_file, "\nEstimating effects for %s/%i.\n",
+ node->name (), node->order);
always_const = gather_context_independent_values (info, &known_csts,
&known_contexts, &known_aggs,
{
struct caller_statistics stats;
inline_hints hints;
- sreal time;
+ sreal time, base_time;
int size;
init_caller_stats (&stats);
node->call_for_symbol_thunks_and_aliases (gather_caller_stats, &stats,
false);
estimate_ipcp_clone_size_and_time (node, known_csts, known_contexts,
- known_aggs_ptrs, &size, &time, &hints);
+ known_aggs_ptrs, &size, &time,
+ &base_time, &hints);
time -= devirt_bonus;
time -= hint_time_bonus (hints);
time -= removable_params_cost;
if (size <= 0 || node->local.local)
{
info->do_clone_for_all_contexts = true;
- base_time = time;
if (dump_file)
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).to_int (),
+ else if (good_cloning_opportunity_p (node,
+ MAX ((base_time - time).to_int (),
+ 65536),
stats.freq_sum, stats.count_sum,
size))
{
if (size + overall_size <= max_new_size)
{
info->do_clone_for_all_contexts = true;
- base_time = time;
overall_size += size;
if (dump_file)
int emc = estimate_move_cost (TREE_TYPE (val->value), true);
perform_estimation_of_a_value (node, known_csts, known_contexts,
- known_aggs_ptrs, base_time,
+ known_aggs_ptrs,
removable_params_cost, emc, val);
if (dump_file && (dump_flags & TDF_DETAILS))
{
known_contexts[i] = val->value;
perform_estimation_of_a_value (node, known_csts, known_contexts,
- known_aggs_ptrs, base_time,
+ known_aggs_ptrs,
removable_params_cost, 0, val);
if (dump_file && (dump_flags & TDF_DETAILS))
vec_safe_push (ajf->items, item);
perform_estimation_of_a_value (node, known_csts, known_contexts,
- known_aggs_ptrs, base_time,
+ known_aggs_ptrs,
removable_params_cost, 0, val);
if (dump_file && (dump_flags & TDF_DETAILS))
known_contexts,
vec<ipa_agg_jump_function_p> known_aggs,
int *ret_size, sreal *ret_time,
+ sreal *ret_nonspec_time,
inline_hints *hints)
{
clause_t clause, nonspec_clause;
- sreal nonspec_time;
evaluate_conditions_for_known_args (node, false, known_vals, known_aggs,
&clause, &nonspec_clause);
estimate_node_size_and_time (node, clause, nonspec_clause,
known_vals, known_contexts,
known_aggs, ret_size, NULL, ret_time,
- &nonspec_time, hints, vNULL);
+ ret_nonspec_time, hints, vNULL);
}
/* Translate all conditions from callee representation into caller