Commit 0bceb671 by Jan Hubicka Committed by Jan Hubicka

ipa-inline-analysis.c (cgraph_2edge_hook_list, [...]): Remove.

	* ipa-inline-analysis.c (cgraph_2edge_hook_list, cgraph_edge_hook_list,
	inline_edge_removal_hook, inline_edge_duplication_hook): Remove.
	(inline_edge_summary_vec): Turn into ...
	(ipa_call_summaries): ... this one.
	(redirect_to_unreachable, edge_set_predicate,
	evaluate_properties_for_edge, inline_summary_alloc,
	reset_ipa_call_summary, reset_inline_summary,
	inline_summary_t::duplicate): Update.
	(inline_edge_duplication_hook): Turn to ...
	(ipa_call_summary_t::duplicate): ... this one.
	(inline_edge_removal_hook): Turn to ...
	(ipa_call_summary_t::remove): ... this one.
	(dump_inline_edge_summary): Turn to ...
	(dump_ipa_call_summary): ... this one.
	(estimate_function_body_sizes): Update.
	(inline_update_callee_summaries): Update.
	(remap_edge_change_prob): Update.
	(remap_edge_summaries): Update.
	(inline_merge_summary): Update.
	(do_estimate_edge_time): Update.
	(inline_generate_summary): Update.
	(inline_read_section): Update.
	(inline_read_summary): Update.
	(inline_free_summary): Update.
	* ipa-inline.c (can_inline_edge_p): Update.
	(compute_inlined_call_time): Update.
	(want_inline_small_function_p): Update.
	(edge_badness): Update.
	(early_inliner): Update.
	* ipa-inline.h (inline_edge_summary): Turn to ...
	(ipa_call_summary): ... this one.
	(ipa_call_summary_t): New class.
	(inline_edge_summary_t, inline_edge_summary_vec): Remove.
	(ipa_call_summaries): New.
	(inline_edge_summary): Remove.
	(estimate_edge_growth): Update.
	* ipa-profile.c (ipa_propagate_frequency_1): Update.
	* ipa-prop.c (ipa_make_edge_direct_to_target): Update.
	* ipa-split.c (execute_split_functions): Update.
	* ipa.c (symbol_table::remove_unreachable_nodes): Update.

From-SVN: r248365
parent 9d029ddf
2017-05-23 Jan Hubicka <hubicka@ucw.cz>
* ipa-inline-analysis.c (cgraph_2edge_hook_list, cgraph_edge_hook_list,
inline_edge_removal_hook, inline_edge_duplication_hook): Remove.
(inline_edge_summary_vec): Turn into ...
(ipa_call_summaries): ... this one.
(redirect_to_unreachable, edge_set_predicate,
evaluate_properties_for_edge, inline_summary_alloc,
reset_ipa_call_summary, reset_inline_summary,
inline_summary_t::duplicate): Update.
(inline_edge_duplication_hook): Turn to ...
(ipa_call_summary_t::duplicate): ... this one.
(inline_edge_removal_hook): Turn to ...
(ipa_call_summary_t::remove): ... this one.
(dump_inline_edge_summary): Turn to ...
(dump_ipa_call_summary): ... this one.
(estimate_function_body_sizes): Update.
(inline_update_callee_summaries): Update.
(remap_edge_change_prob): Update.
(remap_edge_summaries): Update.
(inline_merge_summary): Update.
(do_estimate_edge_time): Update.
(inline_generate_summary): Update.
(inline_read_section): Update.
(inline_read_summary): Update.
(inline_free_summary): Update.
* ipa-inline.c (can_inline_edge_p): Update.
(compute_inlined_call_time): Update.
(want_inline_small_function_p): Update.
(edge_badness): Update.
(early_inliner): Update.
* ipa-inline.h (inline_edge_summary): Turn to ...
(ipa_call_summary): ... this one.
(ipa_call_summary_t): New class.
(inline_edge_summary_t, inline_edge_summary_vec): Remove.
(ipa_call_summaries): New.
(inline_edge_summary): Remove.
(estimate_edge_growth): Update.
* ipa-profile.c (ipa_propagate_frequency_1): Update.
* ipa-prop.c (ipa_make_edge_direct_to_target): Update.
* ipa-split.c (execute_split_functions): Update.
* ipa.c (symbol_table::remove_unreachable_nodes): Update.
2017-05-23 Tom de Vries <tom@codesourcery.com>
* doc/sourcebuild.texi (Effective-Target Keywords, Other hardware
......
......@@ -1468,7 +1468,7 @@ afdo_vpt_for_early_inline (stmt_set *promoted_stmts)
current_function_decl) == NULL)
return false;
compute_inline_parameters (cgraph_node::get (current_function_decl), true);
compute_fn_summary (cgraph_node::get (current_function_decl), true);
bool has_vpt = false;
FOR_EACH_BB_FN (bb, cfun)
......@@ -1592,7 +1592,7 @@ afdo_annotate_cfg (const stmt_set &promoted_stmts)
static void
early_inline ()
{
compute_inline_parameters (cgraph_node::get (current_function_decl), true);
compute_fn_summary (cgraph_node::get (current_function_decl), true);
unsigned todo = early_inliner (cfun);
if (todo & TODO_update_ssa_any)
update_ssa (TODO_update_ssa);
......@@ -1670,7 +1670,7 @@ auto_profile (void)
free_dominance_info (CDI_DOMINATORS);
free_dominance_info (CDI_POST_DOMINATORS);
cgraph_edge::rebuild_edges ();
compute_inline_parameters (cgraph_node::get (current_function_decl), true);
compute_fn_summary (cgraph_node::get (current_function_decl), true);
pop_cfun ();
}
......
......@@ -1389,7 +1389,7 @@ public:
/* True if this decl is a dispatcher for function versions. */
unsigned dispatcher_function : 1;
/* True if this decl calls a COMDAT-local function. This is set up in
compute_inline_parameters and inline_call. */
compute_fn_summary and inline_call. */
unsigned calls_comdat_local : 1;
/* True if node has been created by merge operation in IPA-ICF. */
unsigned icf_merged: 1;
......
......@@ -332,9 +332,17 @@ symbol_table::process_new_functions (void)
push_cfun (DECL_STRUCT_FUNCTION (fndecl));
if ((state == IPA_SSA || state == IPA_SSA_AFTER_INLINING)
&& !gimple_in_ssa_p (DECL_STRUCT_FUNCTION (fndecl)))
g->get_passes ()->execute_early_local_passes ();
else if (inline_summaries != NULL)
compute_inline_parameters (node, true);
{
bool summaried_computed = ipa_fn_summaries != NULL;
g->get_passes ()->execute_early_local_passes ();
/* Early passes compure inline parameters to do inlining
and splitting. This is redundant for functions added late.
Just throw away whatever it did. */
if (!summaried_computed)
inline_free_summary ();
}
else if (ipa_fn_summaries != NULL)
compute_fn_summary (node, true);
free_dominance_info (CDI_POST_DOMINATORS);
free_dominance_info (CDI_DOMINATORS);
pop_cfun ();
......
......@@ -708,7 +708,7 @@ ipcp_cloning_candidate_p (struct cgraph_node *node)
init_caller_stats (&stats);
node->call_for_symbol_thunks_and_aliases (gather_caller_stats, &stats, false);
if (inline_summaries->get (node)->self_size < stats.n_calls)
if (ipa_fn_summaries->get (node)->self_size < stats.n_calls)
{
if (dump_file)
fprintf (dump_file, "Considering %s for cloning; code might shrink.\n",
......@@ -2540,7 +2540,7 @@ devirtualization_time_bonus (struct cgraph_node *node,
for (ie = node->indirect_calls; ie; ie = ie->next_callee)
{
struct cgraph_node *callee;
struct inline_summary *isummary;
struct ipa_fn_summary *isummary;
enum availability avail;
tree target;
bool speculative;
......@@ -2558,7 +2558,7 @@ devirtualization_time_bonus (struct cgraph_node *node,
callee = callee->function_symbol (&avail);
if (avail < AVAIL_AVAILABLE)
continue;
isummary = inline_summaries->get (callee);
isummary = ipa_fn_summaries->get (callee);
if (!isummary->inlinable)
continue;
......@@ -2579,7 +2579,7 @@ devirtualization_time_bonus (struct cgraph_node *node,
/* Return time bonus incurred because of HINTS. */
static int
hint_time_bonus (inline_hints hints)
hint_time_bonus (ipa_hints hints)
{
int result = 0;
if (hints & (INLINE_HINT_loop_iterations | INLINE_HINT_loop_stride))
......@@ -2797,7 +2797,7 @@ perform_estimation_of_a_value (cgraph_node *node, vec<tree> known_csts,
{
int size, time_benefit;
sreal time, base_time;
inline_hints hints;
ipa_hints hints;
estimate_ipcp_clone_size_and_time (node, known_csts, known_contexts,
known_aggs_ptrs, &size, &time,
......@@ -2855,7 +2855,7 @@ estimate_local_effects (struct cgraph_node *node)
|| (removable_params_cost && node->local.can_change_signature))
{
struct caller_statistics stats;
inline_hints hints;
ipa_hints hints;
sreal time, base_time;
int size;
......@@ -3258,7 +3258,7 @@ ipcp_propagate_stage (struct ipa_topo_info *topo)
initialize_node_lattices (node);
}
if (node->definition && !node->alias)
overall_size += inline_summaries->get (node)->self_size;
overall_size += ipa_fn_summaries->get (node)->self_size;
if (node->count > max_count)
max_count = node->count;
}
......@@ -3342,7 +3342,7 @@ ipcp_discover_new_direct_edges (struct cgraph_node *node,
}
/* Turning calls to direct calls will improve overall summary. */
if (found)
inline_update_overall_summary (node);
ipa_update_overall_fn_summary (node);
}
/* Vector of pointers which for linked lists of clones of an original crgaph
......
......@@ -3771,7 +3771,7 @@ ipa_devirt (void)
}
}
if (update)
inline_update_overall_summary (n);
ipa_update_overall_fn_summary (n);
}
if (warn_suggest_final_methods || warn_suggest_final_types)
{
......
......@@ -25,10 +25,10 @@ along with GCC; see the file COPYING3. If not see
#include "ipa-predicate.h"
/* Inline hints are reasons why inline heuristics should preffer inlining given
/* Hints are reasons why IPA heuristics should preffer specializing given
function. They are represtented as bitmap of the following values. */
enum inline_hints_vals {
/* When inlining turns indirect call into a direct call,
enum ipa_hints_vals {
/* When specialization turns indirect call into a direct call,
it is good idea to do so. */
INLINE_HINT_indirect_call = 1,
/* Inlining may make loop iterations or loop stride known. It is good idea
......@@ -42,11 +42,11 @@ enum inline_hints_vals {
win. */
INLINE_HINT_in_scc = 16,
/* If function is declared inline by user, it may be good idea to inline
it. */
it. Set by simple_edge_hints in ipa-inline-analysis.c. */
INLINE_HINT_declared_inline = 32,
/* Programs are usually still organized for non-LTO compilation and thus
if functions are in different modules, inlining may not be so important.
*/
Set by simple_edge_hints in ipa-inline-analysis.c. */
INLINE_HINT_cross_module = 64,
/* If array indexes of loads/stores become known there may be room for
further optimization. */
......@@ -55,7 +55,7 @@ enum inline_hints_vals {
INLINE_HINT_known_hot = 256
};
typedef int inline_hints;
typedef int ipa_hints;
/* Simple description of whether a memory load or a condition refers to a load
from an aggregate and if so, how and where from in the aggregate.
......@@ -69,12 +69,9 @@ struct agg_position_info
bool by_ref;
};
/* Represnetation of function body size and time depending on the inline
/* Representation of function body size and time depending on the call
context. We keep simple array of record, every containing of predicate
and time/size to account.
We keep values scaled up, so fractional sizes can be accounted. */
#define INLINE_SIZE_SCALE 2
and time/size to account. */
struct GTY(()) size_time_entry
{
/* Predicate for code to be executed. */
......@@ -88,7 +85,7 @@ struct GTY(()) size_time_entry
};
/* Function inlining information. */
struct GTY(()) inline_summary
struct GTY(()) ipa_fn_summary
{
/* Information about the function body itself. */
......@@ -116,7 +113,7 @@ struct GTY(()) inline_summary
/* Estimated stack frame consumption by the function. */
HOST_WIDE_INT estimated_stack_size;
/* Expected offset of the stack frame of inlined function. */
/* Expected offset of the stack frame of function. */
HOST_WIDE_INT stack_frame_offset;
/* Estimated size of the function after inlining. */
sreal GTY((skip)) time;
......@@ -146,7 +143,7 @@ struct GTY(()) inline_summary
/* Keep all field empty so summary dumping works during its computation.
This is useful for debugging. */
inline_summary ()
ipa_fn_summary ()
: estimated_self_stack_size (0), self_size (0), min_size (0),
inlinable (false), contains_cilk_spawn (false), single_caller (false),
fp_expressions (false), estimated_stack_size (false),
......@@ -159,32 +156,35 @@ struct GTY(()) inline_summary
/* Record time and size under given predicates. */
void account_size_time (int, sreal, const predicate &, const predicate &);
/* Reset inline summary to empty state. */
/* Reset summary to empty state. */
void reset (struct cgraph_node *node);
/* We keep values scaled up, so fractional sizes can be accounted. */
static const int size_scale = 2;
};
class GTY((user)) inline_summary_t: public function_summary <inline_summary *>
class GTY((user)) ipa_fn_summary_t: public function_summary <ipa_fn_summary *>
{
public:
inline_summary_t (symbol_table *symtab, bool ggc):
function_summary <inline_summary *> (symtab, ggc) {}
ipa_fn_summary_t (symbol_table *symtab, bool ggc):
function_summary <ipa_fn_summary *> (symtab, ggc) {}
static inline_summary_t *create_ggc (symbol_table *symtab)
static ipa_fn_summary_t *create_ggc (symbol_table *symtab)
{
struct inline_summary_t *summary = new (ggc_alloc <inline_summary_t> ())
inline_summary_t(symtab, true);
struct ipa_fn_summary_t *summary = new (ggc_alloc <ipa_fn_summary_t> ())
ipa_fn_summary_t(symtab, true);
summary->disable_insertion_hook ();
return summary;
}
virtual void insert (cgraph_node *, inline_summary *);
virtual void remove (cgraph_node *node, inline_summary *);
virtual void insert (cgraph_node *, ipa_fn_summary *);
virtual void remove (cgraph_node *node, ipa_fn_summary *);
virtual void duplicate (cgraph_node *src, cgraph_node *dst,
inline_summary *src_data, inline_summary *dst_data);
ipa_fn_summary *src_data, ipa_fn_summary *dst_data);
};
extern GTY(()) function_summary <inline_summary *> *inline_summaries;
extern GTY(()) function_summary <ipa_fn_summary *> *ipa_fn_summaries;
/* Information kept about callgraph edges. */
struct ipa_call_summary
......@@ -227,26 +227,24 @@ public:
extern call_summary <ipa_call_summary *> *ipa_call_summaries;
/* In ipa-fnsummary.c */
void debug_inline_summary (struct cgraph_node *);
void dump_inline_summaries (FILE *f);
void dump_inline_summary (FILE *f, struct cgraph_node *node);
void dump_inline_hints (FILE *f, inline_hints);
void ipa_debug_fn_summary (struct cgraph_node *);
void ipa_dump_fn_summaries (FILE *f);
void ipa_dump_fn_summary (FILE *f, struct cgraph_node *node);
void ipa_dump_hints (FILE *f, ipa_hints);
void inline_generate_summary (void);
void inline_read_summary (void);
void inline_write_summary (void);
void inline_free_summary (void);
void inline_analyze_function (struct cgraph_node *node);
int estimate_size_after_inlining (struct cgraph_node *, struct cgraph_edge *);
void estimate_ipcp_clone_size_and_time (struct cgraph_node *,
vec<tree>,
vec<ipa_polymorphic_call_context>,
vec<ipa_agg_jump_function_p>,
int *, sreal *, sreal *,
inline_hints *);
void inline_merge_summary (struct cgraph_edge *edge);
void inline_update_overall_summary (struct cgraph_node *node);
void compute_inline_parameters (struct cgraph_node *, bool);
bool inline_account_function_p (struct cgraph_node *node);
ipa_hints *);
void ipa_merge_fn_summary_after_inlining (struct cgraph_edge *edge);
void ipa_update_overall_fn_summary (struct cgraph_node *node);
void compute_fn_summary (struct cgraph_node *, bool);
void evaluate_properties_for_edge (struct cgraph_edge *e, bool inline_p,
......@@ -265,7 +263,7 @@ void estimate_node_size_and_time (struct cgraph_node *node,
int *ret_size, int *ret_min_size,
sreal *ret_time,
sreal *ret_nonspecialized_time,
inline_hints *ret_hints,
ipa_hints *ret_hints,
vec<inline_param_summary>
inline_param_summary);
......
......@@ -1190,8 +1190,8 @@ sem_function::merge (sem_item *alias_item)
fprintf (dump_file,
"can not create wrapper of stdarg function.\n");
}
else if (inline_summaries
&& inline_summaries->get (alias)->self_size <= 2)
else if (ipa_fn_summaries
&& ipa_fn_summaries->get (alias)->self_size <= 2)
{
if (dump_file)
fprintf (dump_file, "Wrapper creation is not "
......
......@@ -123,9 +123,9 @@ simple_edge_hints (struct cgraph_edge *edge)
struct cgraph_node *to = (edge->caller->global.inlined_to
? edge->caller->global.inlined_to : edge->caller);
struct cgraph_node *callee = edge->callee->ultimate_alias_target ();
if (inline_summaries->get (to)->scc_no
&& inline_summaries->get (to)->scc_no
== inline_summaries->get (callee)->scc_no
if (ipa_fn_summaries->get (to)->scc_no
&& ipa_fn_summaries->get (to)->scc_no
== ipa_fn_summaries->get (callee)->scc_no
&& !edge->recursive_p ())
hints |= INLINE_HINT_same_scc;
......@@ -149,7 +149,7 @@ do_estimate_edge_time (struct cgraph_edge *edge)
{
sreal time, nonspec_time;
int size;
inline_hints hints;
ipa_hints hints;
struct cgraph_node *callee;
clause_t clause, nonspec_clause;
vec<tree> known_vals;
......@@ -187,7 +187,7 @@ do_estimate_edge_time (struct cgraph_edge *edge)
/* When caching, update the cache entry. */
if (edge_growth_cache.exists ())
{
inline_summaries->get (edge->callee)->min_size = min_size;
ipa_fn_summaries->get (edge->callee)->min_size = min_size;
if ((int) edge_growth_cache.length () <= edge->uid)
edge_growth_cache.safe_grow_cleared (symtab->edges_max_uid);
edge_growth_cache[edge->uid].time = time;
......@@ -245,10 +245,10 @@ do_estimate_edge_size (struct cgraph_edge *edge)
/* Estimate the growth of the caller when inlining EDGE.
Only to be called via estimate_edge_size. */
inline_hints
ipa_hints
do_estimate_edge_hints (struct cgraph_edge *edge)
{
inline_hints hints;
ipa_hints hints;
struct cgraph_node *callee;
clause_t clause, nonspec_clause;
vec<tree> known_vals;
......@@ -293,11 +293,11 @@ estimate_size_after_inlining (struct cgraph_node *node,
struct ipa_call_summary *es = ipa_call_summaries->get (edge);
if (!es->predicate || *es->predicate != false)
{
int size = inline_summaries->get (node)->size + estimate_edge_growth (edge);
int size = ipa_fn_summaries->get (node)->size + estimate_edge_growth (edge);
gcc_assert (size >= 0);
return size;
}
return inline_summaries->get (node)->size;
return ipa_fn_summaries->get (node)->size;
}
......@@ -345,7 +345,7 @@ int
estimate_growth (struct cgraph_node *node)
{
struct growth_data d = { node, false, false, 0 };
struct inline_summary *info = inline_summaries->get (node);
struct ipa_fn_summary *info = ipa_fn_summaries->get (node);
node->call_for_symbol_and_aliases (do_estimate_growth_1, &d, true);
......@@ -420,7 +420,7 @@ growth_likely_positive (struct cgraph_node *node,
|| node->address_taken)
return true;
max_callers = inline_summaries->get (node)->size * 4 / edge_growth + 2;
max_callers = ipa_fn_summaries->get (node)->size * 4 / edge_growth + 2;
for (e = node->callers; e; e = e->next_caller)
{
......
......@@ -204,7 +204,7 @@ clone_inlined_nodes (struct cgraph_edge *e, bool duplicate,
{
gcc_assert (!e->callee->alias);
if (overall_size)
*overall_size -= inline_summaries->get (e->callee)->size;
*overall_size -= ipa_fn_summaries->get (e->callee)->size;
nfunctions_inlined++;
}
duplicate = false;
......@@ -288,7 +288,7 @@ mark_all_inlined_calls_cdtor (cgraph_node *node)
indirect edges are discovered in the process, add them to NEW_EDGES, unless
it is NULL. If UPDATE_OVERALL_SUMMARY is false, do not bother to recompute overall
size of caller after inlining. Caller is required to eventually do it via
inline_update_overall_summary.
ipa_update_overall_fn_summary.
If callee_removed is non-NULL, set it to true if we removed callee node.
Return true iff any new callgraph edges were discovered as a
......@@ -358,8 +358,8 @@ inline_call (struct cgraph_edge *e, bool update_original,
reload_optimization_node = true;
}
inline_summary *caller_info = inline_summaries->get (to);
inline_summary *callee_info = inline_summaries->get (callee);
ipa_fn_summary *caller_info = ipa_fn_summaries->get (to);
ipa_fn_summary *callee_info = ipa_fn_summaries->get (callee);
if (!caller_info->fp_expressions && callee_info->fp_expressions)
{
caller_info->fp_expressions = true;
......@@ -451,22 +451,22 @@ inline_call (struct cgraph_edge *e, bool update_original,
gcc_assert (curr->callee->global.inlined_to == to);
old_size = inline_summaries->get (to)->size;
inline_merge_summary (e);
old_size = ipa_fn_summaries->get (to)->size;
ipa_merge_fn_summary_after_inlining (e);
if (e->in_polymorphic_cdtor)
mark_all_inlined_calls_cdtor (e->callee);
if (opt_for_fn (e->caller->decl, optimize))
new_edges_found = ipa_propagate_indirect_call_infos (curr, new_edges);
check_speculations (e->callee);
if (update_overall_summary)
inline_update_overall_summary (to);
ipa_update_overall_fn_summary (to);
else
/* Update self size by the estimate so overall function growth limits
work for further inlining into this function. Before inlining
the function we inlined to again we expect the caller to update
the overall summary. */
inline_summaries->get (to)->size += estimated_growth;
new_size = inline_summaries->get (to)->size;
ipa_fn_summaries->get (to)->size += estimated_growth;
new_size = ipa_fn_summaries->get (to)->size;
if (callee->calls_comdat_local)
to->calls_comdat_local = true;
......@@ -485,7 +485,7 @@ inline_call (struct cgraph_edge *e, bool update_original,
See PR 65654. */
#if 0
/* Verify that estimated growth match real growth. Allow off-by-one
error due to INLINE_SIZE_SCALE roudoff errors. */
error due to ipa_fn_summary::size_scale roudoff errors. */
gcc_assert (!update_overall_summary || !overall_size || new_edges_found
|| abs (estimated_growth - (new_size - old_size)) <= 1
|| speculation_removed
......@@ -500,7 +500,7 @@ inline_call (struct cgraph_edge *e, bool update_original,
*overall_size += new_size - old_size;
ncalls_inlined++;
/* This must happen after inline_merge_summary that rely on jump
/* This must happen after ipa_merge_fn_summary_after_inlining that rely on jump
functions of callee to not be updated. */
return new_edges_found;
}
......
......@@ -27,24 +27,18 @@ struct edge_growth_cache_entry
{
sreal time, nonspec_time;
int size;
inline_hints hints;
ipa_hints hints;
};
extern vec<edge_growth_cache_entry> edge_growth_cache;
/* In ipa-inline-analysis.c */
int estimate_size_after_inlining (struct cgraph_node *, struct cgraph_edge *);
void estimate_ipcp_clone_size_and_time (struct cgraph_node *,
vec<tree>,
vec<ipa_polymorphic_call_context>,
vec<ipa_agg_jump_function_p>,
int *, sreal *, sreal *,
inline_hints *);
int estimate_growth (struct cgraph_node *);
bool growth_likely_positive (struct cgraph_node *, int);
int do_estimate_edge_size (struct cgraph_edge *edge);
sreal do_estimate_edge_time (struct cgraph_edge *edge);
inline_hints do_estimate_edge_hints (struct cgraph_edge *edge);
ipa_hints do_estimate_edge_hints (struct cgraph_edge *edge);
void initialize_growth_caches (void);
void free_growth_caches (void);
......@@ -105,10 +99,10 @@ estimate_edge_time (struct cgraph_edge *edge, sreal *nonspec_time = NULL)
/* Return estimated callee runtime increase after inlining
EDGE. */
static inline inline_hints
static inline ipa_hints
estimate_edge_hints (struct cgraph_edge *edge)
{
inline_hints ret;
ipa_hints ret;
if ((int)edge_growth_cache.length () <= edge->uid
|| !(ret = edge_growth_cache[edge->uid].hints))
return do_estimate_edge_hints (edge);
......
......@@ -387,7 +387,7 @@ predicate::remap_after_duplication (clause_t possible_truths)
/* Translate all conditions from callee representation into caller
representation and symbolically evaluate predicate THIS into new predicate.
INFO is inline_summary of function we are adding predicate into, CALLEE_INFO
INFO is ipa_fn_summary of function we are adding predicate into, CALLEE_INFO
is summary of function predicate P is from. OPERAND_MAP is array giving
callee formal IDs the caller formal IDs. POSSSIBLE_TRUTHS is clausule of all
callee conditions that may be true in caller context. TOPLEV_PREDICATE is
......@@ -398,8 +398,8 @@ predicate::remap_after_duplication (clause_t possible_truths)
for other purposes). */
predicate
predicate::remap_after_inlining (struct inline_summary *info,
struct inline_summary *callee_info,
predicate::remap_after_inlining (struct ipa_fn_summary *info,
struct ipa_fn_summary *callee_info,
vec<int> operand_map,
vec<int> offset_map,
clause_t possible_truths,
......@@ -522,7 +522,7 @@ predicate::stream_out (struct output_block *ob)
It can be NULL, which means this not a load from an aggregate. */
predicate
add_condition (struct inline_summary *summary, int operand_num,
add_condition (struct ipa_fn_summary *summary, int operand_num,
HOST_WIDE_INT size, struct agg_position_info *aggpos,
enum tree_code code, tree val)
{
......
......@@ -205,8 +205,8 @@ public:
predicate remap_after_duplication (clause_t);
/* Return predicate equal to THIS after inlining. */
predicate remap_after_inlining (struct inline_summary *,
struct inline_summary *,
predicate remap_after_inlining (struct ipa_fn_summary *,
struct ipa_fn_summary *,
vec<int>, vec<int>, clause_t, const predicate &);
void stream_in (struct lto_input_block *);
......@@ -227,6 +227,6 @@ private:
};
void dump_condition (FILE *f, conditions conditions, int cond);
predicate add_condition (struct inline_summary *summary, int operand_num,
predicate add_condition (struct ipa_fn_summary *summary, int operand_num,
HOST_WIDE_INT size, struct agg_position_info *aggpos,
enum tree_code code, tree val);
......@@ -679,7 +679,7 @@ ipa_profile (void)
}
}
if (update)
inline_update_overall_summary (n);
ipa_update_overall_fn_summary (n);
}
if (node_map_initialized)
del_node_map ();
......
......@@ -1713,7 +1713,7 @@ split_function (basic_block return_bb, struct split_point *split_point,
}
free_dominance_info (CDI_DOMINATORS);
free_dominance_info (CDI_POST_DOMINATORS);
compute_inline_parameters (node, true);
compute_fn_summary (node, true);
}
/* Execute function splitting pass. */
......@@ -1742,8 +1742,8 @@ execute_split_functions (void)
}
/* This can be relaxed; function might become inlinable after splitting
away the uninlinable part. */
if (inline_summaries
&& !inline_summaries->get (node)->inlinable)
if (ipa_fn_summaries
&& !ipa_fn_summaries->get (node)->inlinable)
{
if (dump_file)
fprintf (dump_file, "Not splitting: not inlinable.\n");
......
......@@ -626,7 +626,7 @@ ipa_merge_profiles (struct cgraph_node *dst,
}
if (!preserve_body)
src->release_body ();
inline_update_overall_summary (dst);
ipa_update_overall_fn_summary (dst);
}
/* TODO: if there is no match, we can scale up. */
src->decl = oldsrcdecl;
......
......@@ -236,8 +236,8 @@ walk_polymorphic_call_targets (hash_set<void *> *reachable_call_targets,
target->order);
}
edge = edge->make_direct (target);
if (inline_summaries)
inline_update_overall_summary (node);
if (ipa_fn_summaries)
ipa_update_overall_fn_summary (node);
else if (edge->call_stmt)
{
edge->redirect_call_stmt_to_callee ();
......@@ -849,7 +849,7 @@ ipa_discover_readonly_nonaddressable_vars (void)
namespace {
const pass_data pass_data_ipa_free_inline_summary =
const pass_data pass_data_ipa_free_fn_summary =
{
SIMPLE_IPA_PASS, /* type */
"free-inline-summary", /* name */
......@@ -865,11 +865,11 @@ const pass_data pass_data_ipa_free_inline_summary =
( TODO_remove_functions | TODO_dump_symtab ), /* todo_flags_finish */
};
class pass_ipa_free_inline_summary : public simple_ipa_opt_pass
class pass_ipa_free_fn_summary : public simple_ipa_opt_pass
{
public:
pass_ipa_free_inline_summary (gcc::context *ctxt)
: simple_ipa_opt_pass (pass_data_ipa_free_inline_summary, ctxt)
pass_ipa_free_fn_summary (gcc::context *ctxt)
: simple_ipa_opt_pass (pass_data_ipa_free_fn_summary, ctxt)
{}
/* opt_pass methods: */
......@@ -879,14 +879,14 @@ public:
return 0;
}
}; // class pass_ipa_free_inline_summary
}; // class pass_ipa_free_fn_summary
} // anon namespace
simple_ipa_opt_pass *
make_pass_ipa_free_inline_summary (gcc::context *ctxt)
make_pass_ipa_free_fn_summary (gcc::context *ctxt)
{
return new pass_ipa_free_inline_summary (ctxt);
return new pass_ipa_free_fn_summary (ctxt);
}
/* Generate and emit a static constructor or destructor. WHICH must
......
......@@ -228,7 +228,7 @@ enum lto_section_type
LTO_section_symtab_nodes,
LTO_section_opts,
LTO_section_cgraph_opt_sum,
LTO_section_inline_summary,
LTO_section_ipa_fn_summary,
LTO_section_ipcp_transform,
LTO_section_ipa_icf,
LTO_section_offload_table,
......
......@@ -153,7 +153,7 @@ add_symbol_to_partition_1 (ltrans_partition part, symtab_node *node)
{
struct cgraph_edge *e;
if (!node->alias)
part->insns += inline_summaries->get (cnode)->self_size;
part->insns += ipa_fn_summaries->get (cnode)->self_size;
/* Add all inline clones and callees that are duplicated. */
for (e = cnode->callees; e; e = e->next_callee)
......@@ -277,7 +277,7 @@ undo_partition (ltrans_partition partition, unsigned int n_nodes)
partition->initializers_visited = NULL;
if (!node->alias && (cnode = dyn_cast <cgraph_node *> (node)))
partition->insns -= inline_summaries->get (cnode)->self_size;
partition->insns -= ipa_fn_summaries->get (cnode)->self_size;
lto_symtab_encoder_delete_node (partition->encoder, node);
node->aux = (void *)((size_t)node->aux - 1);
}
......@@ -480,7 +480,7 @@ lto_balanced_map (int n_lto_partitions, int max_partition_size)
else
order[n_nodes++] = node;
if (!node->alias)
total_size += inline_summaries->get (node)->size;
total_size += ipa_fn_summaries->get (node)->size;
}
original_total_size = total_size;
......@@ -542,14 +542,14 @@ lto_balanced_map (int n_lto_partitions, int max_partition_size)
&& noreorder[noreorder_pos]->order < current_order)
{
if (!noreorder[noreorder_pos]->alias)
total_size -= inline_summaries->get (noreorder[noreorder_pos])->size;
total_size -= ipa_fn_summaries->get (noreorder[noreorder_pos])->size;
next_nodes.safe_push (noreorder[noreorder_pos++]);
}
add_sorted_nodes (next_nodes, partition);
add_symbol_to_partition (partition, order[i]);
if (!order[i]->alias)
total_size -= inline_summaries->get (order[i])->size;
total_size -= ipa_fn_summaries->get (order[i])->size;
/* Once we added a new node to the partition, we also want to add
......
......@@ -139,11 +139,11 @@ along with GCC; see the file COPYING3. If not see
NEXT_PASS (pass_target_clone);
NEXT_PASS (pass_ipa_chkp_produce_thunks);
NEXT_PASS (pass_ipa_auto_profile);
NEXT_PASS (pass_ipa_free_inline_summary);
NEXT_PASS (pass_ipa_tree_profile);
PUSH_INSERT_PASSES_WITHIN (pass_ipa_tree_profile)
NEXT_PASS (pass_feedback_split_functions);
POP_INSERT_PASSES ()
NEXT_PASS (pass_ipa_free_fn_summary);
NEXT_PASS (pass_ipa_increase_alignment);
NEXT_PASS (pass_ipa_tm);
NEXT_PASS (pass_ipa_lower_emutls);
......
......@@ -496,8 +496,7 @@ extern simple_ipa_opt_pass *make_pass_ipa_increase_alignment (gcc::context
*ctxt);
extern ipa_opt_pass_d *make_pass_ipa_inline (gcc::context *ctxt);
extern simple_ipa_opt_pass *make_pass_ipa_free_lang_data (gcc::context *ctxt);
extern simple_ipa_opt_pass *make_pass_ipa_free_inline_summary (gcc::context
*ctxt);
extern simple_ipa_opt_pass *make_pass_ipa_free_fn_summary (gcc::context *ctxt);
extern ipa_opt_pass_d *make_pass_ipa_cp (gcc::context *ctxt);
extern ipa_opt_pass_d *make_pass_ipa_icf (gcc::context *ctxt);
extern ipa_opt_pass_d *make_pass_ipa_devirt (gcc::context *ctxt);
......
......@@ -5204,7 +5204,7 @@ convert_callers_for_node (struct cgraph_node *node,
for (cs = node->callers; cs; cs = cs->next_caller)
if (bitmap_set_bit (recomputed_callers, cs->caller->uid)
&& gimple_in_ssa_p (DECL_STRUCT_FUNCTION (cs->caller->decl)))
compute_inline_parameters (cs->caller, true);
compute_fn_summary (cs->caller, true);
BITMAP_FREE (recomputed_callers);
return true;
......@@ -5381,7 +5381,7 @@ ipa_sra_preliminary_function_checks (struct cgraph_node *node)
}
if ((DECL_ONE_ONLY (node->decl) || DECL_EXTERNAL (node->decl))
&& inline_summaries->get (node)->size >= MAX_INLINE_INSNS_AUTO)
&& ipa_fn_summaries->get (node)->size >= MAX_INLINE_INSNS_AUTO)
{
if (dump_file)
fprintf (dump_file, "Function too big to be made truly local.\n");
......
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