diff options
author | hubicka <hubicka@138bc75d-0d04-0410-961f-82ee72b054a4> | 2012-11-07 09:22:50 +0000 |
---|---|---|
committer | hubicka <hubicka@138bc75d-0d04-0410-961f-82ee72b054a4> | 2012-11-07 09:22:50 +0000 |
commit | 563fae60c3bb55c2d717f710eec508ecaf1f7750 (patch) | |
tree | 6f11a77b72f936b5348f0ab354b8bff4f5899eb3 /gcc/ipa-inline-analysis.c | |
parent | 8c94c5eb1352ac1db21c82c285cb24826e2e45d4 (diff) | |
download | gcc-563fae60c3bb55c2d717f710eec508ecaf1f7750.tar.gz |
* ipa-inline-analysis.c (true_predicate, single_cond_predicate,
reset_inline_edge_summary): Fix
formatting.
(account_size_time): Bump up the limit on number of size/time entries to
256.
(estimate_function_body_sizes): Work in reverse postorder.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@193285 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/ipa-inline-analysis.c')
-rw-r--r-- | gcc/ipa-inline-analysis.c | 21 |
1 files changed, 15 insertions, 6 deletions
diff --git a/gcc/ipa-inline-analysis.c b/gcc/ipa-inline-analysis.c index 7d89d89aae3..15c72ca7f3c 100644 --- a/gcc/ipa-inline-analysis.c +++ b/gcc/ipa-inline-analysis.c @@ -149,7 +149,7 @@ static inline struct predicate true_predicate (void) { struct predicate p; - p.clause[0]=0; + p.clause[0] = 0; return p; } @@ -160,8 +160,8 @@ static inline struct predicate single_cond_predicate (int cond) { struct predicate p; - p.clause[0]=1 << cond; - p.clause[1]=0; + p.clause[0] = 1 << cond; + p.clause[1] = 0; return p; } @@ -692,12 +692,14 @@ account_size_time (struct inline_summary *summary, int size, int time, found = true; break; } - if (i == 32) + if (i == 256) { i = 0; found = true; e = &VEC_index (size_time_entry, summary->entry, 0); gcc_assert (!e->predicate.clause[0]); + if (dump_file && (dump_flags & TDF_DETAILS)) + fprintf (dump_file, "\t\tReached limit on number of entries, ignoring the predicate."); } if (dump_file && (dump_flags & TDF_DETAILS) && (time || size)) { @@ -970,7 +972,7 @@ reset_inline_edge_summary (struct cgraph_edge *e) { struct inline_edge_summary *es = inline_edge_summary (e); - es->call_stmt_size = es->call_stmt_time =0; + es->call_stmt_size = es->call_stmt_time = 0; if (es->predicate) pool_free (edge_predicate_pool, es->predicate); es->predicate = NULL; @@ -2280,6 +2282,8 @@ estimate_function_body_sizes (struct cgraph_node *node, bool early) struct predicate bb_predicate; struct ipa_node_params *parms_info = NULL; VEC (predicate_t, heap) *nonconstant_names = NULL; + int nblocks, n; + int *order; info->conds = 0; info->entry = 0; @@ -2312,8 +2316,12 @@ estimate_function_body_sizes (struct cgraph_node *node, bool early) gcc_assert (my_function && my_function->cfg); if (parms_info) compute_bb_predicates (node, parms_info, info); - FOR_EACH_BB_FN (bb, my_function) + gcc_assert (cfun == my_function); + order = XNEWVEC (int, n_basic_blocks); + nblocks = pre_and_rev_post_order_compute (NULL, order, false); + for (n = 0; n < nblocks; n++) { + bb = BASIC_BLOCK (order[n]); freq = compute_call_stmt_bb_frequency (node->symbol.decl, bb); /* TODO: Obviously predicates can be propagated down across CFG. */ @@ -2486,6 +2494,7 @@ estimate_function_body_sizes (struct cgraph_node *node, bool early) time = (time + CGRAPH_FREQ_BASE / 2) / CGRAPH_FREQ_BASE; if (time > MAX_TIME) time = MAX_TIME; + free (order); if (!early && nonconstant_names) { |