OSDN Git Service

2008-05-15 Richard Guenther <rguenther@suse.de>
[pf3gnuchains/gcc-fork.git] / gcc / tree-ssa-pre.c
index ad628a3..4119467 100644 (file)
@@ -2031,9 +2031,8 @@ compute_antic (void)
       gcc_assert (num_iterations < 50);
     }
 
-  if (dump_file && (dump_flags & TDF_STATS))
-    fprintf (dump_file, "compute_antic required %d iterations\n",
-            num_iterations);
+  statistics_histogram_event (cfun, "compute_antic iterations",
+                             num_iterations);
 
   if (do_partial_partial)
     {
@@ -2061,9 +2060,8 @@ compute_antic (void)
          /* Theoretically possible, but *highly* unlikely.  */
          gcc_assert (num_iterations < 50);
        }
-      if (dump_file && (dump_flags & TDF_STATS))
-       fprintf (dump_file, "compute_partial_antic required %d iterations\n",
-                num_iterations);
+      statistics_histogram_event (cfun, "compute_partial_antic iterations",
+                                 num_iterations);
     }
   sbitmap_free (has_abnormal_preds);
   sbitmap_free (changed_blocks);
@@ -2077,7 +2075,7 @@ can_value_number_call (tree stmt)
 {
   tree call = get_call_expr_in (stmt);
 
-  if (call_expr_flags (call)  & (ECF_PURE | ECF_CONST))
+  if (call_expr_flags (call) & (ECF_PURE | ECF_CONST))
     return true;
   return false;
 }
@@ -2936,8 +2934,7 @@ insert (void)
       new_stuff = false;
       new_stuff = insert_aux (ENTRY_BLOCK_PTR);
     }
-  if (num_iterations > 2 && dump_file && (dump_flags & TDF_STATS))
-    fprintf (dump_file, "insert required %d iterations\n", num_iterations);
+  statistics_histogram_event (cfun, "insert iterations", num_iterations);
 }
 
 
@@ -3369,7 +3366,6 @@ make_values_for_stmt (tree stmt, basic_block block)
            && !SSA_NAME_OCCURS_IN_ABNORMAL_PHI (rhs))
           || is_gimple_min_invariant (rhs)
           || TREE_CODE (rhs) == ADDR_EXPR
-          || TREE_INVARIANT (rhs)
           || DECL_P (rhs))
     {
 
@@ -4020,14 +4016,11 @@ execute_pre (bool do_fre)
   /* Remove all the redundant expressions.  */
   todo |= 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);
-    }
+  statistics_counter_event (cfun, "Insertions", pre_stats.insertions);
+  statistics_counter_event (cfun, "PA inserted", pre_stats.pa_insert);
+  statistics_counter_event (cfun, "New PHIs", pre_stats.phis);
+  statistics_counter_event (cfun, "Eliminated", pre_stats.eliminations);
+  statistics_counter_event (cfun, "Constified", pre_stats.constified);
   bsi_commit_edge_inserts ();
 
   clear_expression_ids ();
@@ -4057,8 +4050,10 @@ gate_pre (void)
   return flag_tree_pre != 0;
 }
 
-struct tree_opt_pass pass_pre =
+struct gimple_opt_pass pass_pre =
 {
+ {
+  GIMPLE_PASS,
   "pre",                               /* name */
   gate_pre,                            /* gate */
   do_pre,                              /* execute */
@@ -4072,8 +4067,8 @@ struct tree_opt_pass pass_pre =
   0,                                   /* properties_destroyed */
   0,                                   /* todo_flags_start */
   TODO_update_ssa_only_virtuals | TODO_dump_func | TODO_ggc_collect
-  | TODO_verify_ssa, /* todo_flags_finish */
-  0                                    /* letter */
+  | TODO_verify_ssa /* todo_flags_finish */
+ }
 };
 
 
@@ -4091,8 +4086,10 @@ gate_fre (void)
   return flag_tree_fre != 0;
 }
 
-struct tree_opt_pass pass_fre =
+struct gimple_opt_pass pass_fre =
 {
+ {
+  GIMPLE_PASS,
   "fre",                               /* name */
   gate_fre,                            /* gate */
   execute_fre,                         /* execute */
@@ -4104,6 +4101,6 @@ struct tree_opt_pass pass_fre =
   0,                                   /* properties_provided */
   0,                                   /* properties_destroyed */
   0,                                   /* todo_flags_start */
-  TODO_dump_func | TODO_ggc_collect | TODO_verify_ssa, /* todo_flags_finish */
-  0                                    /* letter */
+  TODO_dump_func | TODO_ggc_collect | TODO_verify_ssa /* todo_flags_finish */
+ }
 };