public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* PATCH: genautomata enhancement
@ 2007-01-05  0:30 Ben Elliston
  2007-01-08 14:48 ` Vladimir Makarov
  0 siblings, 1 reply; 3+ messages in thread
From: Ben Elliston @ 2007-01-05  0:30 UTC (permalink / raw)
  To: gcc-patches; +Cc: vmakarov

New Year is always a good time to implement enhancements that have been
bugging you for the entire previous year.  :-)

This patch implements one new automata_option for the machine
description ("stats") and expands the role of "time" to cover all time
statistics output produced by genautomata.

In its normal mode of operation, genautomata will now produce no output.
The user must selectively use  the "time" and/or "stats" options to get
the verbose output previously produced.  While developing a pipeline
description, these options can be added to the .md file and then removed
once development is complete.  For day to day builds, it just produces
too much output that is never looked at by developers.

The small documentation change was tested with `make info' and visual
inspection of the results with info(1).

Okay for the trunk?

2007-01-05  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.

Index: genautomata.c
===================================================================
--- genautomata.c       (revision 120450)
+++ genautomata.c       (working copy)
@@ -238,15 +238,11 @@ static arc_t next_out_arc              (
    macros.  */
 
 #define NO_MINIMIZATION_OPTION "-no-minimization"
-
 #define TIME_OPTION "-time"
-
+#define STATS_OPTION "-stats"
 #define V_OPTION "-v"
-
 #define W_OPTION "-w"
-
 #define NDFA_OPTION "-ndfa"
-
 #define PROGRESS_OPTION "-progress"
 
 /* The following flags are set up by function `initiate_automaton_gen'.  */
@@ -267,6 +263,9 @@ static int split_argument;
 /* Flag of output time statistics (`-time').  */
 static int time_flag;
 
+/* Flag of automata statistics (`-stats').  */
+static int stats_flag;
+
 /* Flag of creation of description file which contains description of
    result automaton and statistics information (`-v').  */
 static int v_flag;
@@ -1511,6 +1510,8 @@ gen_automata_option (rtx def)
     no_minimization_flag = 1;
   else if (strcmp (XSTR (def, 0), TIME_OPTION + 1) == 0)
     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)
     v_flag = 1;
   else if (strcmp (XSTR (def, 0), W_OPTION + 1) == 0)
@@ -8937,6 +8938,7 @@ initiate_automaton_gen (int argc, char *
   split_argument = 0;  /* default value */
   no_minimization_flag = 0;
   time_flag = 0;
+  stats_flag = 0;
   v_flag = 0;
   w_flag = 0;
   progress_flag = 0;
@@ -8945,6 +8947,8 @@ initiate_automaton_gen (int argc, char *
       no_minimization_flag = 1;
     else if (strcmp (argv [i], TIME_OPTION) == 0)
       time_flag = 1;
+    else if (strcmp (argv [i], STATS_OPTION) == 0)
+      stats_flag = 1;
     else if (strcmp (argv [i], V_OPTION) == 0)
       v_flag = 1;
     else if (strcmp (argv [i], W_OPTION) == 0)
@@ -9206,9 +9210,11 @@ write_automata (void)
        fprintf (stderr, "done\n");
       output_statistics (output_description_file);
     }
-  output_statistics (stderr);
+  if (stats_flag)
+    output_statistics (stderr);
   ticker_off (&output_time);
-  output_time_statistics (stderr);
+  if (time_flag)
+    output_time_statistics (stderr);
   finish_states ();
   finish_arcs ();
   finish_automata_lists ();
Index: doc/md.texi
===================================================================
--- doc/md.texi (revision 120450)
+++ doc/md.texi (working copy)
@@ -7250,8 +7250,12 @@ only worth to do when we are debugging t
 look more accurately at reservations of states.
 
 @item
-@dfn{time} means printing additional time statistics about
-generation of automata.
+@dfn{time} means printing time statistics about the generation of
+automata.
+
+@item
+@dfn{stats} means printing statistics about the generated automata
+such as the number of DFA states, NDFA states and arcs.
 
 @item
 @dfn{v} means a generation of the file describing the result automata.


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: PATCH: genautomata enhancement
  2007-01-05  0:30 PATCH: genautomata enhancement Ben Elliston
@ 2007-01-08 14:48 ` Vladimir Makarov
  2007-01-08 22:31   ` Ben Elliston
  0 siblings, 1 reply; 3+ messages in thread
From: Vladimir Makarov @ 2007-01-08 14:48 UTC (permalink / raw)
  To: Ben Elliston; +Cc: gcc-patches

Ben Elliston wrote:

>New Year is always a good time to implement enhancements that have been
>bugging you for the entire previous year.  :-)
>
>This patch implements one new automata_option for the machine
>description ("stats") and expands the role of "time" to cover all time
>statistics output produced by genautomata.
>
>In its normal mode of operation, genautomata will now produce no output.
>The user must selectively use  the "time" and/or "stats" options to get
>the verbose output previously produced.  While developing a pipeline
>description, these options can be added to the .md file and then removed
>once development is complete.  For day to day builds, it just produces
>too much output that is never looked at by developers.
>
>The small documentation change was tested with `make info' and visual
>inspection of the results with info(1).
>
>Okay for the trunk?
>  
>
Ben, sorry for the delay with the review.  I was on 2 week vacation.

The patch is completely ok.  You can commit it to the trunk.

And thanks for the patch.

Vlad

>2007-01-05  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.
>
>  
>


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: PATCH: genautomata enhancement
  2007-01-08 14:48 ` Vladimir Makarov
@ 2007-01-08 22:31   ` Ben Elliston
  0 siblings, 0 replies; 3+ messages in thread
From: Ben Elliston @ 2007-01-08 22:31 UTC (permalink / raw)
  To: Vladimir Makarov; +Cc: gcc-patches

On Mon, 2007-01-08 at 09:48 -0500, Vladimir Makarov wrote:

> Ben, sorry for the delay with the review.  I was on 2 week vacation.

No problems -- I had assumed this was the case.

> The patch is completely ok.  You can commit it to the trunk.

Thanks!

Cheers,
Ben


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2007-01-08 22:31 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-01-05  0:30 PATCH: genautomata enhancement Ben Elliston
2007-01-08 14:48 ` Vladimir Makarov
2007-01-08 22:31   ` Ben Elliston

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).