aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-ssa-pre.c
diff options
context:
space:
mode:
authorRichard Guenther <rguenther@suse.de>2008-05-15 13:39:39 +0000
committerRichard Biener <rguenth@gcc.gnu.org>2008-05-15 13:39:39 +0000
commit9fe0cb7d88323ad1be17248b06fd6b071c0a8552 (patch)
tree8b2e7b5f17ea3a9b8184b7bac245f575919ed667 /gcc/tree-ssa-pre.c
parent77f377f70e6ff7e9854be833624c06c4ac567c8c (diff)
downloadgcc-9fe0cb7d88323ad1be17248b06fd6b071c0a8552.zip
gcc-9fe0cb7d88323ad1be17248b06fd6b071c0a8552.tar.gz
gcc-9fe0cb7d88323ad1be17248b06fd6b071c0a8552.tar.bz2
tree-pass.h (current_pass): Declare.
2008-05-15 Richard Guenther <rguenther@suse.de> * tree-pass.h (current_pass): Declare. (get_pass_for_id): Likewise. * passes.c (passes_by_id, passes_by_id_size): New globals. (set_pass_for_id): New function. (get_pass_for_id): Likewise. (register_one_dump_file): Use set_pass_for_id to populate passes_by_id. (execute_function_todo): Flush per function statistics. * toplev.c (compile_file): Init statistics. (general_init): Do early statistics initialization. (finalize): Finish statistics. * statistics.h (statistics_early_init): Declare. (statistics_init): Likewise. (statistics_fini): Likewise. (statistics_fini_pass): Likewise. (statistics_counter_event): Likewise. (statistics_histogram_event): Likewise. * statistics.c: New file. * Makefile.in (OBJS-common): Add statistics.o. (statistics.o): Add dependencies. * doc/invoke.texi (-fdump-statistics): Document. * tree-ssa-pre.c (compute_antic): Use statistics_histogram_event. (insert): Likewise. (execute_pre): Use statistics_counter_event. * tree-ssa-propagate.c (struct prop_stats_d): Add num_dce field. (substitute_and_fold): Increment it. Use statistics_counter_event. * gcc.dg/tree-ssa/loadpre7.c: Adjust scan for not performed transformation. * gcc.dg/tree-ssa/ssa-fre-10.c: Likewise. From-SVN: r135358
Diffstat (limited to 'gcc/tree-ssa-pre.c')
-rw-r--r--gcc/tree-ssa-pre.c26
1 files changed, 10 insertions, 16 deletions
diff --git a/gcc/tree-ssa-pre.c b/gcc/tree-ssa-pre.c
index a8db47d..4119467 100644
--- a/gcc/tree-ssa-pre.c
+++ b/gcc/tree-ssa-pre.c
@@ -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);
@@ -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);
}
@@ -4019,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 ();