diff mbox

displaying static pass numbers on rare verbose execution...

Message ID 20101129134847.GA1184@ours.starynkevitch.net
State New
Headers show

Commit Message

Basile Starynkevitch Nov. 29, 2010, 1:48 p.m. UTC
Hello All,

I would believe it would help a lot newbie GCC developers (and plugin
writers) if the small message displaying pass names on [rare]
non-quiet runs would also give the static pass number, since the
static pass number determinate the dump file, and since these numbers
are not chronological [i.e. in the order of pass runs]

We added some documentation about that numbering 
http://gcc.gnu.org/ml/gcc-patches/2010-11/msg02462.html



I find not easy (and so do some GCC MELT users) to understand the
actual ordering of passes without such information.

Notice that this cannot change the behavior of GCC w.r.t. code
generation, and this only impacts the very few verbose runs of GCC.

################# proposed patch ######
################################################################

#### gcc/ChangeLog entry ###
2010-11-29 Basile Starynkevitch  <basile@starynkevitch.net>
	* passes.c (execute_one_pass): Also display pass static number.
####

Comments are welcome. Ok with what changes?

Cheers

Comments

Richard Biener Nov. 29, 2010, 1:52 p.m. UTC | #1
On Mon, Nov 29, 2010 at 2:48 PM, Basile Starynkevitch
<basile@starynkevitch.net> wrote:
> Hello All,
>
> I would believe it would help a lot newbie GCC developers (and plugin
> writers) if the small message displaying pass names on [rare]
> non-quiet runs would also give the static pass number, since the
> static pass number determinate the dump file, and since these numbers
> are not chronological [i.e. in the order of pass runs]
>
> We added some documentation about that numbering
> http://gcc.gnu.org/ml/gcc-patches/2010-11/msg02462.html
>
>
>
> I find not easy (and so do some GCC MELT users) to understand the
> actual ordering of passes without such information.
>
> Notice that this cannot change the behavior of GCC w.r.t. code
> generation, and this only impacts the very few verbose runs of GCC.
>
> ################# proposed patch ######
> Index: gcc/passes.c
> ===================================================================
> --- gcc/passes.c        (revision 167240)
> +++ gcc/passes.c        (working copy)
> @@ -1537,7 +1537,8 @@ execute_one_pass (struct opt_pass *pass)
>   invoke_plugin_callbacks (PLUGIN_PASS_EXECUTION, pass);
>
>   if (!quiet_flag && !cfun)
> -    fprintf (stderr, " <%s>", pass->name ? pass->name : "");
> +    fprintf (stderr, " <%s/%d>", pass->name ? pass->name : "",
> +             pass->static_pass_number);
>
>   /* Note that the folders should only create gimple expressions.
>      This is a hack until the new folder is ready.  */
> ################################################################
>
> #### gcc/ChangeLog entry ###
> 2010-11-29 Basile Starynkevitch  <basile@starynkevitch.net>
>        * passes.c (execute_one_pass): Also display pass static number.
> ####
>
> Comments are welcome. Ok with what changes?

You probably have noticed that non-quiet runs only print names of
IPA passes.  So I don't think it will address you problem (or any
problem, in fact).

Richard.

> Cheers
>
>
>
> --
> Basile STARYNKEVITCH         http://starynkevitch.net/Basile/
> email: basile<at>starynkevitch<dot>net mobile: +33 6 8501 2359
> 8, rue de la Faiencerie, 92340 Bourg La Reine, France
> *** opinions {are only mines, sont seulement les miennes} ***
>
Basile Starynkevitch Nov. 29, 2010, 2:02 p.m. UTC | #2
On Mon, Nov 29, 2010 at 02:52:54PM +0100, Richard Guenther wrote:
> On Mon, Nov 29, 2010 at 2:48 PM, Basile Starynkevitch
> <basile@starynkevitch.net> wrote:
> > Hello All,
> >
> > I would believe it would help a lot newbie GCC developers (and plugin
> > writers) if the small message displaying pass names on [rare]
> > non-quiet runs would also give the static pass number, since the
> > static pass number determinate the dump file, and since these numbers
> > are not chronological [i.e. in the order of pass runs]
> >
> > We added some documentation about that numbering
> > http://gcc.gnu.org/ml/gcc-patches/2010-11/msg02462.html
> >
> >
> >
> > I find not easy (and so do some GCC MELT users) to understand the
> > actual ordering of passes without such information.

> You probably have noticed that non-quiet runs only print names of
> IPA passes.  

I did notice the test on cfun which is null for IPA passes.

> So I don't think it will address you problem (or any
> problem, in fact).


I respectfully disagree. When trying to add one's IPA pass, it is
useful to understand where should it be inserted, and my small patch
precisely help to understand that.

Of course, it is more useful for people less knowledgeable of GCC that
you are. But I am sure they will find such a small output helpful.

Again, some GCC gurus understand in detail all the ordering of passes,
but some newbies (me included) don't understand all the details of
every passes, and giving some more help would help them. Of course,
the GCC experts working more than ten years on GCC don't need that.

Cheers.
Richard Biener Nov. 29, 2010, 2:22 p.m. UTC | #3
On Mon, Nov 29, 2010 at 3:02 PM, Basile Starynkevitch
<basile@starynkevitch.net> wrote:
> On Mon, Nov 29, 2010 at 02:52:54PM +0100, Richard Guenther wrote:
>> On Mon, Nov 29, 2010 at 2:48 PM, Basile Starynkevitch
>> <basile@starynkevitch.net> wrote:
>> > Hello All,
>> >
>> > I would believe it would help a lot newbie GCC developers (and plugin
>> > writers) if the small message displaying pass names on [rare]
>> > non-quiet runs would also give the static pass number, since the
>> > static pass number determinate the dump file, and since these numbers
>> > are not chronological [i.e. in the order of pass runs]
>> >
>> > We added some documentation about that numbering
>> > http://gcc.gnu.org/ml/gcc-patches/2010-11/msg02462.html
>> >
>> >
>> >
>> > I find not easy (and so do some GCC MELT users) to understand the
>> > actual ordering of passes without such information.
>
>> You probably have noticed that non-quiet runs only print names of
>> IPA passes.
>
> I did notice the test on cfun which is null for IPA passes.
>
>> So I don't think it will address you problem (or any
>> problem, in fact).
>
>
> I respectfully disagree. When trying to add one's IPA pass, it is
> useful to understand where should it be inserted, and my small patch
> precisely help to understand that.
>
> Of course, it is more useful for people less knowledgeable of GCC that
> you are. But I am sure they will find such a small output helpful.
>
> Again, some GCC gurus understand in detail all the ordering of passes,
> but some newbies (me included) don't understand all the details of
> every passes, and giving some more help would help them. Of course,
> the GCC experts working more than ten years on GCC don't need that.

But if you already do not use -quiet then you get passes printed in
execution order ...

Richard,

> Cheers.
>
> --
> Basile STARYNKEVITCH         http://starynkevitch.net/Basile/
> email: basile<at>starynkevitch<dot>net mobile: +33 6 8501 2359
> 8, rue de la Faiencerie, 92340 Bourg La Reine, France
> *** opinions {are only mines, sont seulement les miennes} ***
>
Basile Starynkevitch Nov. 29, 2010, 2:32 p.m. UTC | #4
On Mon, Nov 29, 2010 at 03:22:42PM +0100, Richard Guenther wrote:
[... citing me Basile ....]
> > I respectfully disagree. When trying to add one's IPA pass, it is
> > useful to understand where should it be inserted, and my small patch
> > precisely help to understand that.
> >
> > Of course, it is more useful for people less knowledgeable of GCC that
> > you are. But I am sure they will find such a small output helpful.
> >
> > Again, some GCC gurus understand in detail all the ordering of passes,
> > but some newbies (me included) don't understand all the details of
> > every passes, and giving some more help would help them. Of course,
> > the GCC experts working more than ten years on GCC don't need that.
> 
> But if you already do not use -quiet then you get passes printed in
> execution order ...

Yes, but not their static_number_pass, which is relevant in the dump
files naming. So I still believe that showing the static_number_pass
(which *uniquely* identify a dump file name) will help the newbie.

What I want to explain is that for newbies, which are trying to add a
new passes, they will perhaps pass -fdump-tree-all and -v, and that my
small patch help them understand (for IPA passes) the relationship
between the pass number and its static_number_pass (i.e. its dump file
name).

Take into account that for some people, understand the order of passes
is not as simple as it for gurus like you.

Cheers.
Richard Biener Nov. 29, 2010, 2:43 p.m. UTC | #5
On Mon, Nov 29, 2010 at 3:32 PM, Basile Starynkevitch
<basile@starynkevitch.net> wrote:
> On Mon, Nov 29, 2010 at 03:22:42PM +0100, Richard Guenther wrote:
> [... citing me Basile ....]
>> > I respectfully disagree. When trying to add one's IPA pass, it is
>> > useful to understand where should it be inserted, and my small patch
>> > precisely help to understand that.
>> >
>> > Of course, it is more useful for people less knowledgeable of GCC that
>> > you are. But I am sure they will find such a small output helpful.
>> >
>> > Again, some GCC gurus understand in detail all the ordering of passes,
>> > but some newbies (me included) don't understand all the details of
>> > every passes, and giving some more help would help them. Of course,
>> > the GCC experts working more than ten years on GCC don't need that.
>>
>> But if you already do not use -quiet then you get passes printed in
>> execution order ...
>
> Yes, but not their static_number_pass, which is relevant in the dump
> files naming. So I still believe that showing the static_number_pass
> (which *uniquely* identify a dump file name) will help the newbie.

Huh, but newbies will have no clue how to disable -quiet.  (No, -v
doesn't ;))

Not that I'm against printing the number, I am just very confident
that it doesn't add any useful information to a newbie (unless you
document it, in which case you also can document where to expect
the dump file in a sorted ls output)

Richard.

> What I want to explain is that for newbies, which are trying to add a
> new passes, they will perhaps pass -fdump-tree-all and -v, and that my
> small patch help them understand (for IPA passes) the relationship
> between the pass number and its static_number_pass (i.e. its dump file
> name).
>
> Take into account that for some people, understand the order of passes
> is not as simple as it for gurus like you.
>
> Cheers.
>
> --
> Basile STARYNKEVITCH         http://starynkevitch.net/Basile/
> email: basile<at>starynkevitch<dot>net mobile: +33 6 8501 2359
> 8, rue de la Faiencerie, 92340 Bourg La Reine, France
> *** opinions {are only mines, sont seulement les miennes} ***
>
diff mbox

Patch

Index: gcc/passes.c
===================================================================
--- gcc/passes.c	(revision 167240)
+++ gcc/passes.c	(working copy)
@@ -1537,7 +1537,8 @@  execute_one_pass (struct opt_pass *pass)
   invoke_plugin_callbacks (PLUGIN_PASS_EXECUTION, pass);
 
   if (!quiet_flag && !cfun)
-    fprintf (stderr, " <%s>", pass->name ? pass->name : "");
+    fprintf (stderr, " <%s/%d>", pass->name ? pass->name : "",
+             pass->static_pass_number);
 
   /* Note that the folders should only create gimple expressions.
      This is a hack until the new folder is ready.  */