summaryrefslogtreecommitdiff
path: root/gcc/ipa-inline-analysis.c
diff options
context:
space:
mode:
authorhubicka <hubicka@138bc75d-0d04-0410-961f-82ee72b054a4>2012-10-28 09:50:58 +0000
committerhubicka <hubicka@138bc75d-0d04-0410-961f-82ee72b054a4>2012-10-28 09:50:58 +0000
commit41d39f386a000db16d024d1d08163b2cc42ca1b8 (patch)
tree2dae795a33d41ca45ce797578c0fa418c47bf057 /gcc/ipa-inline-analysis.c
parent85ad240e47dcdc1bf20ef6a95e921ac1f766d995 (diff)
downloadgcc-41d39f386a000db16d024d1d08163b2cc42ca1b8.tar.gz
* ipa-inline.c (edge_badness): Reduce precision; use scc hints.
(inline_small_functions): Fix dumps; update all callees after inlining. * ipa-inline.h (INLINE_HINT_in_scc, INLINE_HINT_same_scc): New constants. (inline summary): Add SCC_NO. * ipa-inline-analysis.c (dump_inline_hints): Dump SCC hints. (reset_inline_summary): Reset scc_no. (estimate_node_size_and_time): Set in_scc hint. (do_estimate_edge_time): Add same_scc hint. (do_estimate_edge_hints): Likewise. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@192888 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/ipa-inline-analysis.c')
-rw-r--r--gcc/ipa-inline-analysis.c26
1 files changed, 25 insertions, 1 deletions
diff --git a/gcc/ipa-inline-analysis.c b/gcc/ipa-inline-analysis.c
index 915f5f2059b..8dd9c6927ed 100644
--- a/gcc/ipa-inline-analysis.c
+++ b/gcc/ipa-inline-analysis.c
@@ -639,6 +639,16 @@ dump_inline_hints (FILE *f, inline_hints hints)
hints &= ~INLINE_HINT_loop_stride;
fprintf (f, " loop_stride");
}
+ if (hints & INLINE_HINT_same_scc)
+ {
+ hints &= ~INLINE_HINT_same_scc;
+ fprintf (f, " same_scc");
+ }
+ if (hints & INLINE_HINT_in_scc)
+ {
+ hints &= ~INLINE_HINT_in_scc;
+ fprintf (f, " in_scc");
+ }
gcc_assert (!hints);
}
@@ -973,6 +983,7 @@ reset_inline_summary (struct cgraph_node *node)
info->stack_frame_offset = 0;
info->size = 0;
info->time = 0;
+ info->scc_no = 0;
if (info->loop_iterations)
{
pool_free (edge_predicate_pool, info->loop_iterations);
@@ -2825,7 +2836,8 @@ estimate_node_size_and_time (struct cgraph_node *node,
if (info->loop_stride
&& !evaluate_predicate (info->loop_stride, possible_truths))
hints |=INLINE_HINT_loop_stride;
-
+ if (info->scc_no)
+ hints |= INLINE_HINT_in_scc;
estimate_calls_size_and_time (node, &size, &time, &hints, possible_truths,
known_vals, known_binfos, known_aggs);
@@ -3323,6 +3335,9 @@ do_estimate_edge_time (struct cgraph_edge *edge)
/* When caching, update the cache entry. */
if (edge_growth_cache)
{
+ struct cgraph_node *to = (edge->caller->global.inlined_to
+ ? edge->caller->global.inlined_to
+ : edge->caller);
if ((int)VEC_length (edge_growth_cache_entry, edge_growth_cache)
<= edge->uid)
VEC_safe_grow_cleared (edge_growth_cache_entry, heap, edge_growth_cache,
@@ -3332,6 +3347,9 @@ do_estimate_edge_time (struct cgraph_edge *edge)
VEC_index (edge_growth_cache_entry, edge_growth_cache, edge->uid).size
= size + (size >= 0);
+ if (inline_summary (to)->scc_no
+ && inline_summary (to)->scc_no == inline_summary (callee)->scc_no)
+ hints |= INLINE_HINT_same_scc;
VEC_index (edge_growth_cache_entry, edge_growth_cache, edge->uid).hints
= hints + 1;
}
@@ -3392,6 +3410,9 @@ do_estimate_edge_hints (struct cgraph_edge *edge)
VEC (tree, heap) *known_vals;
VEC (tree, heap) *known_binfos;
VEC (ipa_agg_jump_function_p, heap) *known_aggs;
+ struct cgraph_node *to = (edge->caller->global.inlined_to
+ ? edge->caller->global.inlined_to
+ : edge->caller);
/* When we do caching, use do_estimate_edge_time to populate the entry. */
@@ -3417,6 +3438,9 @@ do_estimate_edge_hints (struct cgraph_edge *edge)
VEC_free (tree, heap, known_vals);
VEC_free (tree, heap, known_binfos);
VEC_free (ipa_agg_jump_function_p, heap, known_aggs);
+ if (inline_summary (to)->scc_no
+ && inline_summary (to)->scc_no == inline_summary (callee)->scc_no)
+ hints |= INLINE_HINT_same_scc;
return hints;
}