]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
ipa-inline-analysis.c (true_predicate, [...]): Fix formatting.
authorJan Hubicka <jh@suse.cz>
Wed, 7 Nov 2012 09:22:50 +0000 (10:22 +0100)
committerJan Hubicka <hubicka@gcc.gnu.org>
Wed, 7 Nov 2012 09:22:50 +0000 (09:22 +0000)
* 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.

From-SVN: r193285

gcc/ChangeLog
gcc/ipa-inline-analysis.c

index dc62c595db246050911ef693ae702bfd06014979..e1b7657e7e00b6394d22ca965e6bf4ad53611156 100644 (file)
@@ -1,3 +1,12 @@
+2012-11-07  Jan Hubicka  <jh@suse.cz>
+
+       * 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.
+
 2012-11-07  David S. Miller  <davem@davemloft.net>
 
        PR bootstrap/55211
index 7d89d89aae3f908df99665c8dd1a8f5854663daa..15c72ca7f3c3309a616d7aba258a2c11857ff229 100644 (file)
@@ -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)
     {