aboutsummaryrefslogtreecommitdiff
path: root/gcc/cgraph.c
diff options
context:
space:
mode:
authorMartin Liska <mliska@suse.cz>2019-02-18 09:21:23 +0100
committerMartin Liska <marxin@gcc.gnu.org>2019-02-18 08:21:23 +0000
commitdb30281f0b2ff6dfc0c4146291baf020a27e4065 (patch)
tree419ecfa282d86cfaa3d74625e4883e4a619573c9 /gcc/cgraph.c
parente8cecccc2e5abb5d753291892968bf72533a7045 (diff)
downloadgcc-db30281f0b2ff6dfc0c4146291baf020a27e4065.zip
gcc-db30281f0b2ff6dfc0c4146291baf020a27e4065.tar.gz
gcc-db30281f0b2ff6dfc0c4146291baf020a27e4065.tar.bz2
Come up with fast {function,call}_summary classes (PR ipa/89306).
2019-02-18 Martin Liska <mliska@suse.cz> PR ipa/89306 * cgraph.c (symbol_table::create_edge): Set m_summary_id to -1 by default. (symbol_table::free_edge): Recycle m_summary_id. * cgraph.h (get_summary_id): New. (symbol_table::release_symbol): Set m_summary_id to -1 by default. (symbol_table::allocate_cgraph_symbol): Recycle m_summary_id. * ipa-fnsummary.c (ipa_fn_summary_t): Switch from function_summary to fast_function_summary. * ipa-fnsummary.h (ipa_fn_summary_t): Likewise. * ipa-pure-const.c (class funct_state_summary_t): Switch from function_summary to fast_function_summary. * ipa-reference.c (class ipa_ref_var_info_summary_t): Likewise. (class ipa_ref_opt_summary_t): Switch from function_summary to fast_function_summary. * symbol-summary.h (class function_summary_base): New class that is created from base of former function_summary. (function_summary_base::unregister_hooks): New. (class function_summary): Inherit from function_summary_base. (class call_summary_base): New class that is created from base of former call_summary. (class call_summary): Inherit from call_summary_base. (struct is_same): New. (class fast_function_summary): New summary class. (class fast_call_summary): New summary class. * vec.h (vec_safe_grow_cleared): New function. From-SVN: r268979
Diffstat (limited to 'gcc/cgraph.c')
-rw-r--r--gcc/cgraph.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/gcc/cgraph.c b/gcc/cgraph.c
index c9788d0..de82316 100644
--- a/gcc/cgraph.c
+++ b/gcc/cgraph.c
@@ -852,7 +852,10 @@ symbol_table::create_edge (cgraph_node *caller, cgraph_node *callee,
free_edges = NEXT_FREE_EDGE (edge);
}
else
- edge = ggc_alloc<cgraph_edge> ();
+ {
+ edge = ggc_alloc<cgraph_edge> ();
+ edge->m_summary_id = -1;
+ }
edges_count++;
@@ -1014,7 +1017,9 @@ symbol_table::free_edge (cgraph_edge *e)
ggc_free (e->indirect_info);
/* Clear out the edge so we do not dangle pointers. */
+ int summary_id = e->m_summary_id;
memset (e, 0, sizeof (*e));
+ e->m_summary_id = summary_id;
NEXT_FREE_EDGE (e) = free_edges;
free_edges = e;
edges_count--;