/* Analysis used by inlining decision heuristics.
- Copyright (C) 2003-2019 Free Software Foundation, Inc.
+ Copyright (C) 2003-2020 Free Software Foundation, Inc.
Contributed by Jan Hubicka
This file is part of GCC.
node_context_cache_clear = 0;
}
-/* Return hints derrived from EDGE. */
+/* Return hints derived from EDGE. */
int
simple_edge_hints (struct cgraph_edge *edge)
if (to_scc_no && to_scc_no == callee_scc_no && !edge->recursive_p ())
hints |= INLINE_HINT_same_scc;
- if (callee->lto_file_data && edge->caller->lto_file_data
- && edge->caller->lto_file_data != callee->lto_file_data
- && !callee->merged_comdat && !callee->icf_merged)
+ if (cross_module_call_p (edge))
hints |= INLINE_HINT_cross_module;
return hints;
size, since we always need both metrics eventually. */
sreal
-do_estimate_edge_time (struct cgraph_edge *edge)
+do_estimate_edge_time (struct cgraph_edge *edge, sreal *ret_nonspec_time)
{
sreal time, nonspec_time;
int size;
ipa_hints hints;
struct cgraph_node *callee;
clause_t clause, nonspec_clause;
- vec<tree> known_vals;
- vec<ipa_polymorphic_call_context> known_contexts;
- vec<ipa_agg_jump_function_p> known_aggs;
+ auto_vec<tree, 32> known_vals;
+ auto_vec<ipa_polymorphic_call_context, 32> known_contexts;
+ auto_vec<ipa_agg_value_set, 32> known_aggs;
class ipa_call_summary *es = ipa_call_summaries->get (edge);
int min_size = -1;
time = e->entry.time;
nonspec_time = e->entry.nonspec_time;
hints = e->entry.hints;
- if (flag_checking)
+ if (flag_checking
+ && !opt_for_fn (callee->decl, flag_profile_partial_training)
+ && !callee->count.ipa_p ())
{
sreal chk_time, chk_nonspec_time;
int chk_size, chk_min_size;
hints |= simple_edge_hints (edge);
entry->hints = hints + 1;
}
+ if (ret_nonspec_time)
+ *ret_nonspec_time = nonspec_time;
return time;
}
int size;
struct cgraph_node *callee;
clause_t clause, nonspec_clause;
- vec<tree> known_vals;
- vec<ipa_polymorphic_call_context> known_contexts;
- vec<ipa_agg_jump_function_p> known_aggs;
+ auto_vec<tree, 32> known_vals;
+ auto_vec<ipa_polymorphic_call_context, 32> known_contexts;
+ auto_vec<ipa_agg_value_set, 32> known_aggs;
/* When we do caching, use do_estimate_edge_time to populate the entry. */
ipa_hints hints;
struct cgraph_node *callee;
clause_t clause, nonspec_clause;
- vec<tree> known_vals;
- vec<ipa_polymorphic_call_context> known_contexts;
- vec<ipa_agg_jump_function_p> known_aggs;
+ auto_vec<tree, 32> known_vals;
+ auto_vec<ipa_polymorphic_call_context, 32> known_contexts;
+ auto_vec<ipa_agg_value_set, 32> known_aggs;
/* When we do caching, use do_estimate_edge_time to populate the entry. */
Take this into account. */
else if (DECL_COMDAT (node->decl)
&& node->can_remove_if_no_direct_calls_p ())
- return (info->size
- * (100 - param_comdat_sharing_probability)
- + 50) / 100;
+ {
+ int prob = opt_for_fn (node->decl, param_comdat_sharing_probability);
+ return (info->size * (100 - prob) + 50) / 100;
+ }
}
return 0;
}
-/* Estimate the growth caused by inlining NODE into all callees. */
+/* Estimate the growth caused by inlining NODE into all callers. */
int
estimate_growth (struct cgraph_node *node)