diff options
author | Jan Hubicka <jh@suse.cz> | 2019-11-04 15:07:09 +0100 |
---|---|---|
committer | Jan Hubicka <hubicka@gcc.gnu.org> | 2019-11-04 14:07:09 +0000 |
commit | 7237f93eb3aaecb27800ce1688ece4c4cbcb790b (patch) | |
tree | de11c563dd2b2c4fbed7b425e99ea70d6cb79842 /gcc/ipa-inline-analysis.c | |
parent | 6fb349540ce6464e9222d4c236a2c43a174d058b (diff) | |
download | gcc-7237f93eb3aaecb27800ce1688ece4c4cbcb790b.zip gcc-7237f93eb3aaecb27800ce1688ece4c4cbcb790b.tar.gz gcc-7237f93eb3aaecb27800ce1688ece4c4cbcb790b.tar.bz2 |
cgraphclones.c (cgraph_node::create_version_clone): Do not duplicate summaries.
* cgraphclones.c (cgraph_node::create_version_clone): Do not
duplicate summaries.
* ipa-fnsummary.c (ipa_fn_summary_alloc): Allocate size summary
first.
(ipa_fn_summary_t::duplicate): Use get instead of get_create to
access call summaries.
(dump_ipa_call_summary): Be ready for missing edge summaries.
(analyze_function_body): Use get instead of get_create to access
edge summary.
(estimate_calls_size_and_time): Do not access summaries of
inlined edges; sanity check they are missing.
(ipa_call_context::estimate_size_and_time): Use get instead
of get_create to access node summary.
(inline_update_callee_summaries): Do not update depth of
inlined edge.
(ipa_merge_fn_summary_after_inlining): Remove inline edge from
growth caches.
(ipa_merge_fn_summary_after_inlining): Use get instead
of get_create.
* ipa-fnsummary.h (ipa_remove_from_growth_caches): Declare.
* ipa-inline-analyssi.c (edge_growth_cache): Turn to
fast summary.
(initialize_growth_caches): Update.
(do_estimate_edge_time): Remove redundant copy of context.
(ipa_remove_from_growth_caches): New function.
* ipa-inline.c (flatten_function): Update overall summary
only when optimizing.
(inline_to_all_callers): Update overall summary of function
inlined to.
* ipa-inline.h (edge_growth_cache): Turn to fast summary.
* symbol-summary.h (call_summary_base): Set m_initialize_when_cloning
to false.
From-SVN: r277780
Diffstat (limited to 'gcc/ipa-inline-analysis.c')
-rw-r--r-- | gcc/ipa-inline-analysis.c | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/gcc/ipa-inline-analysis.c b/gcc/ipa-inline-analysis.c index 4363105..ea1fae4 100644 --- a/gcc/ipa-inline-analysis.c +++ b/gcc/ipa-inline-analysis.c @@ -51,7 +51,7 @@ along with GCC; see the file COPYING3. If not see #include "gimplify.h" /* Cached node/edge growths. */ -call_summary<edge_growth_cache_entry *> *edge_growth_cache = NULL; +fast_call_summary<edge_growth_cache_entry *, va_heap> *edge_growth_cache = NULL; /* The context cache remembers estimated time/size and hints for given ipa_call_context of a call. */ @@ -125,7 +125,7 @@ void initialize_growth_caches () { edge_growth_cache - = new call_summary<edge_growth_cache_entry *> (symtab, false); + = new fast_call_summary<edge_growth_cache_entry *, va_heap> (symtab); node_context_cache = new fast_function_summary<node_context_summary *, va_heap> (symtab); } @@ -219,7 +219,6 @@ do_estimate_edge_time (struct cgraph_edge *edge) else node_context_cache_clear++; e->entry.ctx.release (true); - e->entry.ctx = ctx; ctx.estimate_size_and_time (&size, &min_size, &time, &nonspec_time, &hints); e->entry.size = size; @@ -275,6 +274,16 @@ reset_node_cache (struct cgraph_node *node) node_context_cache->remove (node); } +/* Remove EDGE from caches once it was inlined. */ +void +ipa_remove_from_growth_caches (struct cgraph_edge *edge) +{ + if (node_context_cache) + node_context_cache->remove (edge->callee); + if (edge_growth_cache) + edge_growth_cache->remove (edge); +} + /* Return estimated callee growth after inlining EDGE. Only to be called via estimate_edge_size. */ |