diff options
author | hubicka <hubicka@138bc75d-0d04-0410-961f-82ee72b054a4> | 2015-01-14 03:47:17 +0000 |
---|---|---|
committer | hubicka <hubicka@138bc75d-0d04-0410-961f-82ee72b054a4> | 2015-01-14 03:47:17 +0000 |
commit | bc42c20ce3b3d2bc564e96f0951dddc26a0084cd (patch) | |
tree | d263aa4b3c8e49114fabaca0cafcda95de3c39a4 /gcc/ipa-inline.c | |
parent | 02a3b1979c7b4262cc350163355ed67a69faf971 (diff) | |
download | gcc-bc42c20ce3b3d2bc564e96f0951dddc26a0084cd.tar.gz |
PR ipa/64481
* ipa-inline-analysis.c (node_growth_cache): Remove.
(initialize_growth_caches): Do not initialize it.
(free_growth_caches): Do not free it.
(do_estimate_growth): Rename to ...
(estimate_growth): ... this one; drop growth cache code.
(growth_likely_positive): Always go the heuristics way.
* ipa-inline.c (can_inline_edge_p): Walk through aliases.
(reset_edge_caches): Do not reset node growth.
(heap_edge_removal_hook): Do not maintain cache.
(inline_small_functions): Likewise; strenghten sanity check.
(ipa_inline): Do not maintain caches.
* ipa-inline.h (node_growth_cache): Remove.
(do_estimate_growth): Remove to ...
(estimate_growth): this one; remove inline version.
(reset_node_growth_cache): Remove.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@219572 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/ipa-inline.c')
-rw-r--r-- | gcc/ipa-inline.c | 25 |
1 files changed, 12 insertions, 13 deletions
diff --git a/gcc/ipa-inline.c b/gcc/ipa-inline.c index 61e470f303e..96d618e0024 100644 --- a/gcc/ipa-inline.c +++ b/gcc/ipa-inline.c @@ -388,11 +388,11 @@ can_inline_edge_p (struct cgraph_edge *e, bool report, else if (caller_tree != callee_tree) { if (((opt_for_fn (e->caller->decl, optimize) - > opt_for_fn (e->callee->decl, optimize)) + > opt_for_fn (callee->decl, optimize)) || (opt_for_fn (e->caller->decl, optimize_size) - != opt_for_fn (e->callee->decl, optimize_size))) + != opt_for_fn (callee->decl, optimize_size))) /* gcc.dg/pr43564.c. Look at forced inline even in -O0. */ - && !DECL_DISREGARD_INLINE_LIMITS (e->callee->decl)) + && !DECL_DISREGARD_INLINE_LIMITS (callee->decl)) { e->inline_failed = CIF_OPTIMIZATION_MISMATCH; inlinable = false; @@ -1095,9 +1095,6 @@ reset_edge_caches (struct cgraph_node *node) if (where->global.inlined_to) where = where->global.inlined_to; - /* WHERE body size has changed, the cached growth is invalid. */ - reset_node_growth_cache (where); - for (edge = where->callers; edge; edge = edge->next_caller) if (edge->inline_failed) reset_edge_growth_cache (edge); @@ -1428,8 +1425,6 @@ add_new_edges_to_heap (edge_heap_t *heap, vec<cgraph_edge *> new_edges) static void heap_edge_removal_hook (struct cgraph_edge *e, void *data) { - if (e->callee) - reset_node_growth_cache (e->callee); if (e->aux) { ((edge_heap_t *)data)->delete_node ((edge_heap_node_t *)e->aux); @@ -1622,7 +1617,6 @@ inline_small_functions (void) struct cgraph_node *where = node->global.inlined_to ? node->global.inlined_to : node; inline_update_overall_summary (where); - reset_node_growth_cache (where); reset_edge_caches (where); update_caller_keys (&edge_heap, where, updated_nodes, NULL); @@ -1653,8 +1647,15 @@ inline_small_functions (void) #ifdef ENABLE_CHECKING /* Be sure that caches are maintained consistent. */ sreal cached_badness = edge_badness (edge, false); + + int old_size_est = estimate_edge_size (edge); + int old_time_est = estimate_edge_time (edge); + int old_hints_est = estimate_edge_hints (edge); + reset_edge_growth_cache (edge); - reset_node_growth_cache (edge->callee); + gcc_assert (old_size_est == estimate_edge_size (edge)); + gcc_assert (old_time_est == estimate_edge_time (edge)); + gcc_assert (old_hints_est == estimate_edge_hints (edge)); /* When updating the edge costs, we only decrease badness in the keys. Increases of badness are handled lazilly; when we see key with out @@ -1785,8 +1786,7 @@ inline_small_functions (void) inline_call (edge, true, &new_indirect_edges, &overall_size, true); add_new_edges_to_heap (&edge_heap, new_indirect_edges); - reset_edge_caches (edge->callee); - reset_node_growth_cache (callee); + reset_edge_caches (edge->callee->function_symbol ()); update_callee_keys (&edge_heap, where, updated_nodes); } @@ -2218,7 +2218,6 @@ ipa_inline (void) { struct cgraph_node *where = node->global.inlined_to ? node->global.inlined_to : node; - reset_node_growth_cache (where); reset_edge_caches (where); inline_update_overall_summary (where); } |