[PATCH][RFC] Statistics patch, updated

Richard Guenther rguenther@suse.de
Sun Mar 16 12:51:00 GMT 2008


I killed the (optional) stmt parameter and added the ability to produce
per compilation unit (-fdump-statistics-stats) and per function
(-fdump-statistics) in addition to per event (-fdump-statistics-details)
statistic logs.  I also converted PRE, noting that I need to adjust
testcases sometimes and noting that passes do more fancy statistics
that do not fit this scheme of events (number of iterations of an
algorithm in this case, where you could record an event per iteration
of course).

Bootstrapped and tested on x86_64-unknown-linux-gnu.

I don't want to spend too much time on this, so for all suggestions
please come up with incremental patches ;)  I volunteer to transition
all TDF_STATS counters we have (not too much ;)) though.

Hm, ok for tunk? ;)

Thanks,
Richard.

2008-03-16  Richard Guenther  <rguenther@suse.de>

	* tree-pass.h (statistics_init): Declare.
	(statistics_fini): Likewise.
	(statistics_add_raw): Likewise.
	(statistics_add_fn): New macro.
	(statistics_add): Likewise.
	* passes.c (statistics_dump_nr, statistics_dump_file,
	statistics_dump_flags, passes_by_id, passes_by_id_size): New globals.
	(register_one_dump_file): Populate static pass number to pass
	mapping.
	(init_optimization_passes): Register statistics dump.
	(execute_function_todo): Flush per function statistics.
	(struct statistics_counter_s): New structure.
	(statistics_fini_pass): New function.
	(statistics_fini): Likewise.
	(statistics_init): Likewise.
	(statistics_add_raw): Likewise.
	* toplev.c (compile_file): Init statistics.
	(finalize): Finish statistics.

	* tree-ssa-propagate.c: Use statistics infrastructure.
	* tree-ssa-pre.c: Likewise.

	* gcc.dg/tree-ssa/loadpre7.c: Adjust scan for not performed
	transformation.
	* gcc.dg/tree-ssa/ssa-fre-10.c: Likewise.

Index: trunk/gcc/passes.c
===================================================================
*** trunk.orig/gcc/passes.c	2008-03-15 19:20:34.000000000 +0100
--- trunk/gcc/passes.c	2008-03-16 11:30:24.000000000 +0100
*************** along with GCC; see the file COPYING3.  
*** 102,107 ****
--- 102,112 ----
  				   declarations for e.g. AIX 4.x.  */
  #endif
  
+ static void statistics_fini_pass (void);
+ static int statistics_dump_nr;
+ static int statistics_dump_flags;
+ static FILE *statistics_dump_file;
+ 
  /* This is used for debugging.  It allows the current pass to printed
     from anywhere in compilation.  */
  struct tree_opt_pass *current_pass;
*************** struct tree_opt_pass pass_postreload =
*** 328,333 ****
--- 333,340 ----
  
  /* The root of the compilation pass tree, once constructed.  */
  struct tree_opt_pass *all_passes, *all_ipa_passes, *all_lowering_passes;
+ struct tree_opt_pass **passes_by_id;
+ int passes_by_id_size;
  
  /* Iterate over the pass tree allocating dump file numbers.  We want
     to do this depth first, and independent of whether the pass is
*************** register_one_dump_file (struct tree_opt_
*** 359,364 ****
--- 366,381 ----
    glob_name = concat (prefix, pass->name, NULL);
    pass->static_pass_number = dump_register (dot_name, flag_name, glob_name,
                                              flags, pass->letter);
+ 
+   if (passes_by_id_size <= pass->static_pass_number)
+     {
+       passes_by_id = xrealloc (passes_by_id,
+ 	  		       (pass->static_pass_number + 1) * sizeof (void *));
+       memset (passes_by_id + passes_by_id_size, 0,
+ 	      (pass->static_pass_number + 1 - passes_by_id_size) * sizeof (void *));
+       passes_by_id_size = pass->static_pass_number + 1;
+     }
+   passes_by_id[pass->static_pass_number] = pass;
  }
  
  /* Recursive worker function for register_dump_files.  */
*************** init_optimization_passes (void)
*** 797,802 ****
--- 814,821 ----
    register_dump_files (all_passes, false,
  		       PROP_gimple_any | PROP_gimple_lcf | PROP_gimple_leh
  		       | PROP_cfg);
+   statistics_dump_nr = dump_register (".statistics", "statistics",
+ 				      "statistics", TDF_TREE, 0);
  }
  
  /* If we are in IPA mode (i.e., current_function_decl is NULL), call
*************** execute_function_todo (void *data)
*** 883,889 ****
    flags &= ~cfun->last_verified;
    if (!flags)
      return;
!   
    /* Always cleanup the CFG before trying to update SSA.  */
    if (flags & TODO_cleanup_cfg)
      {
--- 902,910 ----
    flags &= ~cfun->last_verified;
    if (!flags)
      return;
! 
!   statistics_fini_pass ();
! 
    /* Always cleanup the CFG before trying to update SSA.  */
    if (flags & TODO_cleanup_cfg)
      {
*************** execute_ipa_pass_list (struct tree_opt_p
*** 1198,1201 ****
--- 1219,1444 ----
      }
    while (pass);
  }
+ 
+ /* Statistics entry.  A integer counter associated to a string ID.  */
+ 
+ typedef struct statistics_counter_s {
+   const char *id;
+   unsigned HOST_WIDE_INT count;
+   unsigned HOST_WIDE_INT prev_dumped_count;
+ } statistics_counter_t;
+ 
+ /* Array of statistic hashes, indexed by pass id.  */
+ 
+ static htab_t *statistics_hashes;
+ static unsigned nr_statistics_hashes;
+ 
+ static char statistics_print_buf[4096];
+ 
+ /* Hash a statistic counter by its string ID.  */
+ 
+ static hashval_t
+ hash_statistics_hash (const void *p)
+ {
+   return htab_hash_string (((statistics_counter_t *)p)->id);
+ }
+ 
+ /* Compare two statistic counters by their string IDs.  */
+ 
+ static int
+ hash_statistics_eq (const void *p, const void *q)
+ {
+   return !strcmp (((statistics_counter_t *)p)->id,
+ 		  ((statistics_counter_t *)q)->id);
+ }
+ 
+ /* Return the current hashtable to be used for recording or printing
+    statistics.  */
+ 
+ static htab_t
+ curr_statistics_hash (void)
+ {
+   unsigned idx = current_pass->static_pass_number;
+ 
+   if (idx < nr_statistics_hashes
+       && statistics_hashes[idx] != NULL)
+     return statistics_hashes[idx];
+ 
+   if (idx >= nr_statistics_hashes)
+     {
+       statistics_hashes = xrealloc (statistics_hashes,
+ 				    (idx + 1) * sizeof (htab_t));
+       memset (statistics_hashes + nr_statistics_hashes, 0,
+ 	      (idx + 1 - nr_statistics_hashes) * sizeof (htab_t));
+       nr_statistics_hashes = idx + 1;
+     }
+ 
+   statistics_hashes[idx] = htab_create (15, hash_statistics_hash,
+ 					hash_statistics_eq, free);
+ 
+   return statistics_hashes[idx];
+ }
+ 
+ /* Helper for statistics_fini_pass.  Print the counter difference
+    since the last dump for the pass dump files.  */
+ 
+ static int
+ statistics_fini_pass_1 (void **slot, void *data ATTRIBUTE_UNUSED)
+ {
+   statistics_counter_t *counter = (statistics_counter_t *)*slot;
+   unsigned HOST_WIDE_INT count = counter->count - counter->prev_dumped_count;
+   if (count == 0)
+     return 1;
+   fprintf (dump_file, "%s: " HOST_WIDE_INT_PRINT_DEC "\n",
+ 	   counter->id, count);
+   counter->prev_dumped_count = counter->count;
+   return 1;
+ }
+ 
+ /* Helper for statistics_fini_pass.  Print the counter difference
+    since the last dump for the statistics dump.  */
+ 
+ static int
+ statistics_fini_pass_2 (void **slot, void *data ATTRIBUTE_UNUSED)
+ {
+   statistics_counter_t *counter = (statistics_counter_t *)*slot;
+   unsigned HOST_WIDE_INT count = counter->count - counter->prev_dumped_count;
+   if (count == 0)
+     return 1;
+   counter->prev_dumped_count = counter->count;
+   snprintf (statistics_print_buf, 4096,
+ 	    "%d %s \"%s\" \"%s\" " HOST_WIDE_INT_PRINT_DEC "\n",
+ 	    current_pass->static_pass_number,
+ 	    current_pass->name,
+ 	    counter->id,
+ 	    cfun ? IDENTIFIER_POINTER (DECL_NAME (cfun->decl)) : "(nofn)",
+ 	    count);
+   fputs (statistics_print_buf, statistics_dump_file);
+   counter->prev_dumped_count = counter->count;
+   return 1;
+ }
+ 
+ /* Helper for statistics_fini_pass, reset the counters.  */
+ 
+ static int
+ statistics_fini_pass_3 (void **slot, void *data ATTRIBUTE_UNUSED)
+ {
+   statistics_counter_t *counter = (statistics_counter_t *)*slot;
+   counter->prev_dumped_count = counter->count;
+   return 1;
+ }
+ 
+ /* Dump the current statistics incrementally.  */
+ 
+ static void
+ statistics_fini_pass (void)
+ {
+   if (current_pass->static_pass_number == -1)
+     return;
+ 
+   if (dump_file
+       && dump_flags & TDF_STATS)
+     {
+       fprintf (dump_file, "\n");
+       fprintf (dump_file, "Pass statistics:\n");
+       fprintf (dump_file, "----------------\n");
+       htab_traverse_noresize (curr_statistics_hash (),
+ 			      statistics_fini_pass_1, NULL);
+       fprintf (dump_file, "\n");
+     }
+   if (statistics_dump_file
+       && !(statistics_dump_flags & TDF_STATS
+ 	   || statistics_dump_flags & TDF_DETAILS))
+     htab_traverse_noresize (curr_statistics_hash (),
+ 			    statistics_fini_pass_2, NULL);
+   htab_traverse_noresize (curr_statistics_hash (),
+ 			  statistics_fini_pass_3, NULL);
+ }
+ 
+ /* Helper for printing summary information.  */
+ 
+ static int
+ statistics_fini_1 (void **slot, void *data)
+ {
+   struct tree_opt_pass *pass = (struct tree_opt_pass *)data;
+   statistics_counter_t *counter = (statistics_counter_t *)*slot;
+   if (counter->count == 0)
+     return 1;
+   snprintf (statistics_print_buf, 4096,
+ 	    "%d %s \"%s\" " HOST_WIDE_INT_PRINT_DEC "\n",
+ 	    pass->static_pass_number,
+ 	    pass->name,
+ 	    counter->id,
+ 	    counter->count);
+   fputs (statistics_print_buf, statistics_dump_file);
+   return 1;
+ }
+ 
+ /* Finish the statistics and dump summary information.  */
+ 
+ void
+ statistics_fini (void)
+ {
+   if (!statistics_dump_file)
+     return;
+ 
+   if (statistics_dump_flags & TDF_STATS)
+     {
+       unsigned i;
+       for (i = 0; i < nr_statistics_hashes; ++i)
+ 	if (statistics_hashes[i] != NULL
+ 	    && passes_by_id[i] != NULL)
+ 	  htab_traverse_noresize (statistics_hashes[i],
+ 				  statistics_fini_1, passes_by_id[i]);
+     }
+ 
+   dump_end (statistics_dump_nr, statistics_dump_file);
+ }
+ 
+ /* Init the statistics.  */
+ 
+ void
+ statistics_init (void)
+ {
+   statistics_dump_file = dump_begin (statistics_dump_nr, NULL);
+   statistics_dump_flags = get_dump_file_info (statistics_dump_nr)->flags;
+ }
+ 
+ /* Add statistics information about event ID in function FN at statement
+    STMT.  This will increment a counter associated with ID.  It will also
+    dump the event to the global statistics file if requested.  */
+ 
+ void
+ statistics_add_raw (struct function *fn, const char *id)
+ {
+   statistics_counter_t **counter;
+   htab_t hash;
+ 
+   if (!(dump_flags & TDF_STATS)
+       && !statistics_dump_file)
+     return;
+ 
+   hash = curr_statistics_hash ();
+   counter = (statistics_counter_t **) htab_find_slot (hash, &id, INSERT);
+   if (!*counter)
+     {
+       *counter = XNEW (struct statistics_counter_s);
+       (*counter)->id = id;
+       (*counter)->prev_dumped_count = 0;
+       (*counter)->count = 0;
+     }
+   (*counter)->count++;
+ 
+   if (!statistics_dump_file
+       || !(statistics_dump_flags & TDF_DETAILS))
+     return;
+ 
+   snprintf (statistics_print_buf, 4096,
+ 	    "%d %s \"%s\" \"%s\"\n",
+ 	    current_pass->static_pass_number,
+ 	    current_pass->name,
+ 	    id,
+ 	    fn ? IDENTIFIER_POINTER (DECL_NAME (fn->decl)) : "(nofn)");
+   fputs (statistics_print_buf, statistics_dump_file);
+ }
  #include "gt-passes.h"
Index: trunk/gcc/tree-pass.h
===================================================================
*** trunk.orig/gcc/tree-pass.h	2008-03-15 19:20:34.000000000 +0100
--- trunk/gcc/tree-pass.h	2008-03-16 10:53:36.000000000 +0100
*************** extern void debug_pass (void);
*** 468,471 ****
--- 468,479 ----
     directly in jump threading, and avoid peeling them next time.  */
  extern bool first_pass_instance;
  
+ extern void statistics_init (void);
+ extern void statistics_fini (void);
+ extern void statistics_add_raw (struct function *, const char *);
+ #define statistics_add_fn(fn, id) \
+   do { statistics_add_raw ((fn), (id)); } while (0)
+ #define statistics_add(id) \
+   do { statistics_add_raw (cfun, (id)); } while (0)
+ 
  #endif /* GCC_TREE_PASS_H */
Index: trunk/gcc/tree-ssa-propagate.c
===================================================================
*** trunk.orig/gcc/tree-ssa-propagate.c	2008-03-15 19:20:34.000000000 +0100
--- trunk/gcc/tree-ssa-propagate.c	2008-03-16 11:34:57.000000000 +0100
*************** get_value_loaded_by (tree stmt, prop_val
*** 884,899 ****
  }
  
  
- /* Propagation statistics.  */
- struct prop_stats_d
- {
-   long num_const_prop;
-   long num_copy_prop;
-   long num_pred_folded;
- };
- 
- static struct prop_stats_d prop_stats;
- 
  /* Replace USE references in statement STMT with the values stored in
     PROP_VALUE. Return true if at least one reference was replaced.  If
     REPLACED_ADDRESSES_P is given, it will be set to true if an address
--- 884,889 ----
*************** replace_uses_in (tree stmt, bool *replac
*** 923,931 ****
  	continue;
  
        if (TREE_CODE (val) != SSA_NAME)
! 	prop_stats.num_const_prop++;
        else
! 	prop_stats.num_copy_prop++;
  
        propagate_value (use, val);
  
--- 913,921 ----
  	continue;
  
        if (TREE_CODE (val) != SSA_NAME)
! 	statistics_add ("Constants propagated");
        else
! 	statistics_add ("Copies propagated");
  
        propagate_value (use, val);
  
*************** replace_vuses_in (tree stmt, bool *repla
*** 1038,1046 ****
  	  GIMPLE_STMT_OPERAND (stmt, 1) = val->value;
  
  	  if (TREE_CODE (val->value) != SSA_NAME)
! 	    prop_stats.num_const_prop++;
  	  else
! 	    prop_stats.num_copy_prop++;
  
  	  /* Since we have replaced the whole RHS of STMT, there
  	     is no point in checking the other VUSEs, as they will
--- 1028,1036 ----
  	  GIMPLE_STMT_OPERAND (stmt, 1) = val->value;
  
  	  if (TREE_CODE (val->value) != SSA_NAME)
! 	    statistics_add ("Constants propagated");
  	  else
! 	    statistics_add ("Copies propagated");
  
  	  /* Since we have replaced the whole RHS of STMT, there
  	     is no point in checking the other VUSEs, as they will
*************** replace_vuses_in (tree stmt, bool *repla
*** 1066,1072 ****
  	continue;
  
        propagate_value (vuse, val);
!       prop_stats.num_copy_prop++;
        replaced = true;
      }
  
--- 1056,1062 ----
  	continue;
  
        propagate_value (vuse, val);
!       statistics_add ("Copies propagated");
        replaced = true;
      }
  
*************** replace_phi_args_in (tree phi, prop_valu
*** 1098,1106 ****
  	  if (val && val != arg && may_propagate_copy (arg, val))
  	    {
  	      if (TREE_CODE (val) != SSA_NAME)
! 		prop_stats.num_const_prop++;
  	      else
! 		prop_stats.num_copy_prop++;
  
  	      propagate_value (PHI_ARG_DEF_PTR (phi, i), val);
  	      replaced = true;
--- 1088,1096 ----
  	  if (val && val != arg && may_propagate_copy (arg, val))
  	    {
  	      if (TREE_CODE (val) != SSA_NAME)
! 		statistics_add ("Constants propagated");
  	      else
! 		statistics_add ("Copies propagated");
  
  	      propagate_value (PHI_ARG_DEF_PTR (phi, i), val);
  	      replaced = true;
*************** fold_predicate_in (tree stmt)
*** 1163,1169 ****
  	  fprintf (dump_file, "\n");
  	}
  
!       prop_stats.num_pred_folded++;
        *pred_p = val;
        return true;
      }
--- 1153,1159 ----
  	  fprintf (dump_file, "\n");
  	}
  
!       statistics_add ("Predicates folded");
        *pred_p = val;
        return true;
      }
*************** substitute_and_fold (prop_value_t *prop_
*** 1198,1205 ****
    if (dump_file && (dump_flags & TDF_DETAILS))
      fprintf (dump_file, "\nSubstituing values and folding statements\n\n");
  
-   memset (&prop_stats, 0, sizeof (prop_stats));
- 
    /* Substitute values in every statement of every basic block.  */
    FOR_EACH_BB (bb)
      {
--- 1188,1193 ----
*************** substitute_and_fold (prop_value_t *prop_
*** 1301,1315 ****
  	}
      }
  
-   if (dump_file && (dump_flags & TDF_STATS))
-     {
-       fprintf (dump_file, "Constants propagated: %6ld\n",
- 	       prop_stats.num_const_prop);
-       fprintf (dump_file, "Copies propagated:    %6ld\n",
- 	       prop_stats.num_copy_prop);
-       fprintf (dump_file, "Predicates folded:    %6ld\n",
- 	       prop_stats.num_pred_folded);
-     }
    return something_changed;
  }
  
--- 1289,1294 ----
Index: trunk/gcc/toplev.c
===================================================================
*** trunk.orig/gcc/toplev.c	2008-03-16 10:53:50.000000000 +0100
--- trunk/gcc/toplev.c	2008-03-16 11:14:42.000000000 +0100
*************** compile_file (void)
*** 951,956 ****
--- 951,957 ----
    init_cgraph ();
    init_final (main_input_filename);
    coverage_init (aux_base_name);
+   statistics_init ();
  
    timevar_push (TV_PARSE);
  
*************** finalize (void)
*** 2118,2123 ****
--- 2119,2125 ----
  	fatal_error ("error closing %s: %m", asm_file_name);
      }
  
+   statistics_fini ();
    finish_optimization_passes ();
  
    if (mem_report)
Index: trunk/gcc/testsuite/gcc.dg/tree-ssa/loadpre7.c
===================================================================
*** trunk.orig/gcc/testsuite/gcc.dg/tree-ssa/loadpre7.c	2008-03-16 11:39:25.000000000 +0100
--- trunk/gcc/testsuite/gcc.dg/tree-ssa/loadpre7.c	2008-03-16 11:39:45.000000000 +0100
*************** enormlz (x)
*** 13,17 ****
        eshup8 (x);
      }
  }
! /* { dg-final { scan-tree-dump-times "Eliminated: 0" 1 "pre"} } */
  /* { dg-final { cleanup-tree-dump "pre" } } */
--- 13,17 ----
        eshup8 (x);
      }
  }
! /* { dg-final { scan-tree-dump-not "Eliminated:" "pre"} } */
  /* { dg-final { cleanup-tree-dump "pre" } } */
Index: trunk/gcc/testsuite/gcc.dg/tree-ssa/ssa-fre-10.c
===================================================================
*** trunk.orig/gcc/testsuite/gcc.dg/tree-ssa/ssa-fre-10.c	2008-03-16 11:39:29.000000000 +0100
--- trunk/gcc/testsuite/gcc.dg/tree-ssa/ssa-fre-10.c	2008-03-16 11:39:58.000000000 +0100
*************** void __frame_state_for (volatile char *s
*** 16,20 ****
      }
  }
  
! /* { dg-final { scan-tree-dump "Insertions: 0" "pre" } } */
  /* { dg-final { cleanup-tree-dump "pre" } } */
--- 16,20 ----
      }
  }
  
! /* { dg-final { scan-tree-dump-not "Insertions:" "pre" } } */
  /* { dg-final { cleanup-tree-dump "pre" } } */
Index: trunk/gcc/tree-ssa-pre.c
===================================================================
*** trunk.orig/gcc/tree-ssa-pre.c	2008-03-16 11:35:28.000000000 +0100
--- trunk/gcc/tree-ssa-pre.c	2008-03-16 11:38:30.000000000 +0100
*************** static bitmap_set_t maximal_set;
*** 354,380 ****
  /* Basic block list in postorder.  */
  static int *postorder;
  
- /* This structure is used to keep track of statistics on what
-    optimization PRE was able to perform.  */
- static struct
- {
-   /* The number of RHS computations eliminated by PRE.  */
-   int eliminations;
- 
-   /* The number of new expressions/temporaries generated by PRE.  */
-   int insertions;
- 
-   /* The number of inserts found due to partial anticipation  */
-   int pa_insert;
- 
-   /* The number of new PHI nodes added by PRE.  */
-   int phis;
- 
-   /* The number of values found constant.  */
-   int constified;
- 
- } pre_stats;
- 
  static bool do_partial_partial;
  static tree bitmap_find_leader (bitmap_set_t, tree, tree);
  static void bitmap_value_insert_into_set (bitmap_set_t, tree);
--- 354,359 ----
*************** create_expression_by_pieces (basic_block
*** 2478,2484 ****
      bitmap_value_replace_in_set (NEW_SETS (block), name);
    bitmap_value_replace_in_set (AVAIL_OUT (block), name);
  
!   pre_stats.insertions++;
    if (dump_file && (dump_flags & TDF_DETAILS))
      {
        fprintf (dump_file, "Inserted ");
--- 2457,2463 ----
      bitmap_value_replace_in_set (NEW_SETS (block), name);
    bitmap_value_replace_in_set (AVAIL_OUT (block), name);
  
!   statistics_add ("Insertions");
    if (dump_file && (dump_flags & TDF_DETAILS))
      {
        fprintf (dump_file, "Inserted ");
*************** insert_into_preds_of_block (basic_block 
*** 2619,2625 ****
        print_generic_expr (dump_file, temp, 0);
        fprintf (dump_file, " in block %d\n", block->index);
      }
!   pre_stats.phis++;
    return true;
  }
  
--- 2598,2604 ----
        print_generic_expr (dump_file, temp, 0);
        fprintf (dump_file, " in block %d\n", block->index);
      }
!   statistics_add ("New PHIs");
    return true;
  }
  
*************** do_regular_insertion (basic_block block,
*** 2757,2763 ****
  		  if (TREE_CODE (expr) == SSA_NAME)
  		    {
  		      vn_add (expr, eprime);
! 		      pre_stats.constified++;
  		    }
  		}
  	    }
--- 2736,2742 ----
  		  if (TREE_CODE (expr) == SSA_NAME)
  		    {
  		      vn_add (expr, eprime);
! 		      statistics_add ("Constified");
  		    }
  		}
  	    }
*************** do_partial_partial_insertion (basic_bloc
*** 2859,2865 ****
  	     partially redundant.  */
  	  if (!cant_insert && by_all)
  	    {
! 	      pre_stats.pa_insert++;
  	      if (insert_into_preds_of_block (block, get_expression_id (expr),
  					      avail))
  		new_stuff = true;
--- 2838,2844 ----
  	     partially redundant.  */
  	  if (!cant_insert && by_all)
  	    {
! 	      statistics_add ("PA inserted");
  	      if (insert_into_preds_of_block (block, get_expression_id (expr),
  					      avail))
  		new_stuff = true;
*************** eliminate (void)
*** 3674,3680 ****
  						    TREE_TYPE (sprime)))
  		    sprime = fold_convert (TREE_TYPE (*rhs_p), sprime);
  
! 		  pre_stats.eliminations++;
  		  propagate_tree_value (rhs_p, sprime);
  		  update_stmt (stmt);
  
--- 3653,3659 ----
  						    TREE_TYPE (sprime)))
  		    sprime = fold_convert (TREE_TYPE (*rhs_p), sprime);
  
! 		  statistics_add ("Eliminated");
  		  propagate_tree_value (rhs_p, sprime);
  		  update_stmt (stmt);
  
*************** init_pre (bool do_fre)
*** 3834,3841 ****
      loop_optimizer_init (LOOPS_NORMAL);
  
    connect_infinite_loops_to_exit ();
-   memset (&pre_stats, 0, sizeof (pre_stats));
- 
  
    postorder = XNEWVEC (int, n_basic_blocks - NUM_FIXED_BLOCKS);
    post_order_compute (postorder, false, false);
--- 3813,3818 ----
*************** execute_pre (bool do_fre)
*** 3980,3993 ****
    /* Remove all the redundant expressions.  */
    eliminate ();
  
-   if (dump_file && (dump_flags & TDF_STATS))
-     {
-       fprintf (dump_file, "Insertions: %d\n", pre_stats.insertions);
-       fprintf (dump_file, "PA inserted: %d\n", pre_stats.pa_insert);
-       fprintf (dump_file, "New PHIs: %d\n", pre_stats.phis);
-       fprintf (dump_file, "Eliminated: %d\n", pre_stats.eliminations);
-       fprintf (dump_file, "Constified: %d\n", pre_stats.constified);
-     }
    bsi_commit_edge_inserts ();
  
    clear_expression_ids ();
--- 3957,3962 ----



More information about the Gcc-patches mailing list