Add iteration count to DOM stats
Diego Novillo
dnovillo@redhat.com
Fri Jul 29 14:40:00 GMT 2005
Used it to evaluate the upcoming fix to PR 22550.
* tree-ssa-dom.c (struct opt_stats_d): Add field num_iterations.
(tree_ssa_dominator_optimize): Increment it.
(dump_dominator_optimization_stats): Print it.
Index: tree-ssa-dom.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/tree-ssa-dom.c,v
retrieving revision 2.125
diff -d -u -p -r2.125 tree-ssa-dom.c
--- tree-ssa-dom.c 28 Jul 2005 16:29:55 -0000 2.125
+++ tree-ssa-dom.c 29 Jul 2005 04:30:40 -0000
@@ -166,6 +166,7 @@ struct opt_stats_d
long num_re;
long num_const_prop;
long num_copy_prop;
+ long num_iterations;
};
static struct opt_stats_d opt_stats;
@@ -524,6 +525,8 @@ tree_ssa_dominator_optimize (void)
if (value && !is_gimple_min_invariant (value))
SSA_NAME_VALUE (name) = NULL;
}
+
+ opt_stats.num_iterations++;
}
while (optimize > 1 && cfg_altered);
@@ -1356,6 +1359,9 @@ dump_dominator_optimization_stats (FILE
fprintf (file, " Copies propagated: %6ld\n",
opt_stats.num_copy_prop);
+ fprintf (file, "\nTotal number of DOM iterations: %6ld\n",
+ opt_stats.num_iterations);
+
fprintf (file, "\nHash table statistics:\n");
fprintf (file, " avail_exprs: ");
More information about the Gcc-patches
mailing list