Commit df1133a6 by Ben Elliston Committed by Ben Elliston

genautomata.c (STATS_OPTION): New option.

	* genautomata.c (STATS_OPTION): New option.
	(stats_flag): New flag.
	(gen_automata_option): Handle it.
	(initiate_automaton_gen): Ditto.
	(write_automata): Output statistics only if stats_flag is
	set. Likewise, output time statistics only if time_flag is set.
	* doc/md.texi (Processor pipeline description): Document new flag.

From-SVN: r120594
parent 2b60792f
2007-01-09 Ben Elliston <bje@au.ibm.com>
* genautomata.c (STATS_OPTION): New option.
(stats_flag): New flag.
(gen_automata_option): Handle it.
(initiate_automaton_gen): Ditto.
(write_automata): Output statistics only if stats_flag is
set. Likewise, output time statistics only if time_flag is set.
* doc/md.texi (Processor pipeline description): Document new flag.
2007-01-08 Richard Guenther <rguenther@suse.de> 2007-01-08 Richard Guenther <rguenther@suse.de>
* builtins.c (fold_builtin_int_roundingfn): Use fit_double_type. * builtins.c (fold_builtin_int_roundingfn): Use fit_double_type.
......
...@@ -7250,8 +7250,12 @@ only worth to do when we are debugging the description and need to ...@@ -7250,8 +7250,12 @@ only worth to do when we are debugging the description and need to
look more accurately at reservations of states. look more accurately at reservations of states.
@item @item
@dfn{time} means printing additional time statistics about @dfn{time} means printing time statistics about the generation of
generation of automata. automata.
@item
@dfn{stats} means printing statistics about the generated automata
such as the number of DFA states, NDFA states and arcs.
@item @item
@dfn{v} means a generation of the file describing the result automata. @dfn{v} means a generation of the file describing the result automata.
......
/* Pipeline hazard description translator. /* Pipeline hazard description translator.
Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005 Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2007
Free Software Foundation, Inc. Free Software Foundation, Inc.
Written by Vladimir Makarov <vmakarov@redhat.com> Written by Vladimir Makarov <vmakarov@redhat.com>
...@@ -238,15 +238,11 @@ static arc_t next_out_arc (arc_t); ...@@ -238,15 +238,11 @@ static arc_t next_out_arc (arc_t);
macros. */ macros. */
#define NO_MINIMIZATION_OPTION "-no-minimization" #define NO_MINIMIZATION_OPTION "-no-minimization"
#define TIME_OPTION "-time" #define TIME_OPTION "-time"
#define STATS_OPTION "-stats"
#define V_OPTION "-v" #define V_OPTION "-v"
#define W_OPTION "-w" #define W_OPTION "-w"
#define NDFA_OPTION "-ndfa" #define NDFA_OPTION "-ndfa"
#define PROGRESS_OPTION "-progress" #define PROGRESS_OPTION "-progress"
/* The following flags are set up by function `initiate_automaton_gen'. */ /* The following flags are set up by function `initiate_automaton_gen'. */
...@@ -267,6 +263,9 @@ static int split_argument; ...@@ -267,6 +263,9 @@ static int split_argument;
/* Flag of output time statistics (`-time'). */ /* Flag of output time statistics (`-time'). */
static int time_flag; static int time_flag;
/* Flag of automata statistics (`-stats'). */
static int stats_flag;
/* Flag of creation of description file which contains description of /* Flag of creation of description file which contains description of
result automaton and statistics information (`-v'). */ result automaton and statistics information (`-v'). */
static int v_flag; static int v_flag;
...@@ -1511,6 +1510,8 @@ gen_automata_option (rtx def) ...@@ -1511,6 +1510,8 @@ gen_automata_option (rtx def)
no_minimization_flag = 1; no_minimization_flag = 1;
else if (strcmp (XSTR (def, 0), TIME_OPTION + 1) == 0) else if (strcmp (XSTR (def, 0), TIME_OPTION + 1) == 0)
time_flag = 1; time_flag = 1;
else if (strcmp (XSTR (def, 0), STATS_OPTION + 1) == 0)
stats_flag = 1;
else if (strcmp (XSTR (def, 0), V_OPTION + 1) == 0) else if (strcmp (XSTR (def, 0), V_OPTION + 1) == 0)
v_flag = 1; v_flag = 1;
else if (strcmp (XSTR (def, 0), W_OPTION + 1) == 0) else if (strcmp (XSTR (def, 0), W_OPTION + 1) == 0)
...@@ -8937,6 +8938,7 @@ initiate_automaton_gen (int argc, char **argv) ...@@ -8937,6 +8938,7 @@ initiate_automaton_gen (int argc, char **argv)
split_argument = 0; /* default value */ split_argument = 0; /* default value */
no_minimization_flag = 0; no_minimization_flag = 0;
time_flag = 0; time_flag = 0;
stats_flag = 0;
v_flag = 0; v_flag = 0;
w_flag = 0; w_flag = 0;
progress_flag = 0; progress_flag = 0;
...@@ -8945,6 +8947,8 @@ initiate_automaton_gen (int argc, char **argv) ...@@ -8945,6 +8947,8 @@ initiate_automaton_gen (int argc, char **argv)
no_minimization_flag = 1; no_minimization_flag = 1;
else if (strcmp (argv [i], TIME_OPTION) == 0) else if (strcmp (argv [i], TIME_OPTION) == 0)
time_flag = 1; time_flag = 1;
else if (strcmp (argv [i], STATS_OPTION) == 0)
stats_flag = 1;
else if (strcmp (argv [i], V_OPTION) == 0) else if (strcmp (argv [i], V_OPTION) == 0)
v_flag = 1; v_flag = 1;
else if (strcmp (argv [i], W_OPTION) == 0) else if (strcmp (argv [i], W_OPTION) == 0)
...@@ -9206,9 +9210,11 @@ write_automata (void) ...@@ -9206,9 +9210,11 @@ write_automata (void)
fprintf (stderr, "done\n"); fprintf (stderr, "done\n");
output_statistics (output_description_file); output_statistics (output_description_file);
} }
output_statistics (stderr); if (stats_flag)
output_statistics (stderr);
ticker_off (&output_time); ticker_off (&output_time);
output_time_statistics (stderr); if (time_flag)
output_time_statistics (stderr);
finish_states (); finish_states ();
finish_arcs (); finish_arcs ();
finish_automata_lists (); finish_automata_lists ();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment