* [PATCH] Print Pass Names
@ 2015-05-22 17:04 Aditya K
2015-05-22 19:59 ` Richard Biener
0 siblings, 1 reply; 7+ messages in thread
From: Aditya K @ 2015-05-22 17:04 UTC (permalink / raw)
To: gcc-patches
Currently, when we print the passes it does not print its name. This becomes confusing when we want to print all the passes at once (e.g., -fdump-tree-all-all=stderr &> pass.dump).
This patch adds functionality to print the pass name. It passes bootstrap (with default configurations).
Hope this is useful.
Thanks,
-Aditya
gcc/ChangeLog:
2015-05-22 Aditya Kumar <hiraditya@msn.com>
* passes.c (execute_todo): Added a parameter to pass the pass name.
(execute_one_pass): Likewise
* statistics.c (statistics_fini_pass): Likewise
* statistics.h: Likewise
---
gcc/passes.c | 9 +++++----
gcc/statistics.c | 4 ++--
gcc/statistics.h | 2 +-
3 files changed, 8 insertions(+), 7 deletions(-)
diff --git a/gcc/passes.c b/gcc/passes.c
index 04ff042..7d41bd8 100644
--- a/gcc/passes.c
+++ b/gcc/passes.c
@@ -1984,7 +1984,7 @@ execute_function_todo (function *fn, void *data)
/* Perform all TODO actions. */
static void
-execute_todo (unsigned int flags)
+execute_todo (unsigned int flags, const char *pass_name=NULL)
{
#if defined ENABLE_CHECKING
if (cfun
@@ -1997,7 +1997,7 @@ execute_todo (unsigned int flags)
/* Inform the pass whether it is the first time it is run. */
first_pass_instance = (flags & TODO_mark_first_instance) != 0;
- statistics_fini_pass ();
+ statistics_fini_pass (pass_name);
if (flags)
do_per_function (execute_function_todo, (void *)(size_t) flags);
@@ -2302,7 +2302,7 @@ execute_one_pass (opt_pass *pass)
pass_init_dump_file (pass);
/* Run pre-pass verification. */
- execute_todo (pass->todo_flags_start);
+ execute_todo (pass->todo_flags_start, pass->name);
#ifdef ENABLE_CHECKING
do_per_function (verify_curr_properties,
@@ -2327,7 +2327,8 @@ execute_one_pass (opt_pass *pass)
check_profile_consistency (pass->static_pass_number, 0, true);
/* Run post-pass cleanup and verification. */
- execute_todo (todo_after | pass->todo_flags_finish | TODO_verify_il);
+ execute_todo (todo_after | pass->todo_flags_finish | TODO_verify_il,
+ pass->name);
if (profile_report && cfun && (cfun->curr_properties & PROP_cfg))
check_profile_consistency (pass->static_pass_number, 1, true);
diff --git a/gcc/statistics.c b/gcc/statistics.c
index 8cbe88d..54f81d5 100644
--- a/gcc/statistics.c
+++ b/gcc/statistics.c
@@ -192,7 +192,7 @@ statistics_fini_pass_3 (statistics_counter_t **slot,
/* Dump the current statistics incrementally. */
void
-statistics_fini_pass (void)
+statistics_fini_pass (const char *pass_name)
{
if (current_pass->static_pass_number == -1)
return;
@@ -201,7 +201,7 @@ statistics_fini_pass (void)
&& dump_flags & TDF_STATS)
{
fprintf (dump_file, "\n");
- fprintf (dump_file, "Pass statistics:\n");
+ fprintf (dump_file, "Pass statistics of \"%s\":\n", pass_name);
fprintf (dump_file, "----------------\n");
curr_statistics_hash ()
->traverse_noresize <void *, statistics_fini_pass_1> (NULL);
diff --git a/gcc/statistics.h b/gcc/statistics.h
index 0b871ec..4348b7a 100644
--- a/gcc/statistics.h
+++ b/gcc/statistics.h
@@ -64,7 +64,7 @@ struct function;
extern void statistics_early_init (void);
extern void statistics_init (void);
extern void statistics_fini (void);
-extern void statistics_fini_pass (void);
+extern void statistics_fini_pass (const char *pass_name = NULL);
extern void statistics_counter_event (struct function *, const char *, int);
extern void statistics_histogram_event (struct function *, const char *, int);
--
2.1.0.243.g30d45f7
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] Print Pass Names
2015-05-22 17:04 [PATCH] Print Pass Names Aditya K
@ 2015-05-22 19:59 ` Richard Biener
2015-05-22 20:55 ` Aditya K
0 siblings, 1 reply; 7+ messages in thread
From: Richard Biener @ 2015-05-22 19:59 UTC (permalink / raw)
To: Aditya K, gcc-patches
On May 22, 2015 6:32:38 PM GMT+02:00, Aditya K <hiraditya@msn.com> wrote:
>Currently, when we print the passes it does not print its name. This
>becomes confusing when we want to print all the passes at once (e.g.,
>-fdump-tree-all-all=stderr &> pass.dump).
>This patch adds functionality to print the pass name. It passes
>bootstrap (with default configurations).
>
>Hope this is useful.
Can't you just use current_pass->name?
Richard.
>Thanks,
>-Aditya
>
>
>gcc/ChangeLog:
>
>2015-05-22 Aditya Kumar <hiraditya@msn.com>
>
> * passes.c (execute_todo): Added a parameter to pass the pass name.
> (execute_one_pass): Likewise
> * statistics.c (statistics_fini_pass): Likewise
> * statistics.h: Likewise
>
>---
> gcc/passes.c | 9 +++++----
> gcc/statistics.c | 4 ++--
> gcc/statistics.h | 2 +-
> 3 files changed, 8 insertions(+), 7 deletions(-)
>
>diff --git a/gcc/passes.c b/gcc/passes.c
>index 04ff042..7d41bd8 100644
>--- a/gcc/passes.c
>+++ b/gcc/passes.c
>@@ -1984,7 +1984,7 @@ execute_function_todo (function *fn, void *data)
>
> /* Perform all TODO actions. */
> static void
>-execute_todo (unsigned int flags)
>+execute_todo (unsigned int flags, const char *pass_name=NULL)
> {
> #if defined ENABLE_CHECKING
> if (cfun
>@@ -1997,7 +1997,7 @@ execute_todo (unsigned int flags)
> /* Inform the pass whether it is the first time it is run. */
> first_pass_instance = (flags & TODO_mark_first_instance) != 0;
>
>- statistics_fini_pass ();
>+ statistics_fini_pass (pass_name);
>
> if (flags)
> do_per_function (execute_function_todo, (void *)(size_t) flags);
>@@ -2302,7 +2302,7 @@ execute_one_pass (opt_pass *pass)
> pass_init_dump_file (pass);
>
> /* Run pre-pass verification. */
>- execute_todo (pass->todo_flags_start);
>+ execute_todo (pass->todo_flags_start, pass->name);
>
> #ifdef ENABLE_CHECKING
> do_per_function (verify_curr_properties,
>@@ -2327,7 +2327,8 @@ execute_one_pass (opt_pass *pass)
> check_profile_consistency (pass->static_pass_number, 0, true);
>
> /* Run post-pass cleanup and verification. */
>- execute_todo (todo_after | pass->todo_flags_finish |
>TODO_verify_il);
>+ execute_todo (todo_after | pass->todo_flags_finish | TODO_verify_il,
>+ pass->name);
> if (profile_report && cfun && (cfun->curr_properties & PROP_cfg))
> check_profile_consistency (pass->static_pass_number, 1, true);
>
>diff --git a/gcc/statistics.c b/gcc/statistics.c
>index 8cbe88d..54f81d5 100644
>--- a/gcc/statistics.c
>+++ b/gcc/statistics.c
>@@ -192,7 +192,7 @@ statistics_fini_pass_3 (statistics_counter_t
>**slot,
> /* Dump the current statistics incrementally. */
>
> void
>-statistics_fini_pass (void)
>+statistics_fini_pass (const char *pass_name)
> {
> if (current_pass->static_pass_number == -1)
> return;
>@@ -201,7 +201,7 @@ statistics_fini_pass (void)
> && dump_flags & TDF_STATS)
> {
> fprintf (dump_file, "\n");
>- fprintf (dump_file, "Pass statistics:\n");
>+ fprintf (dump_file, "Pass statistics of \"%s\":\n", pass_name);
> fprintf (dump_file, "----------------\n");
> curr_statistics_hash ()
> ->traverse_noresize <void *, statistics_fini_pass_1> (NULL);
>diff --git a/gcc/statistics.h b/gcc/statistics.h
>index 0b871ec..4348b7a 100644
>--- a/gcc/statistics.h
>+++ b/gcc/statistics.h
>@@ -64,7 +64,7 @@ struct function;
> extern void statistics_early_init (void);
> extern void statistics_init (void);
> extern void statistics_fini (void);
>-extern void statistics_fini_pass (void);
>+extern void statistics_fini_pass (const char *pass_name = NULL);
>extern void statistics_counter_event (struct function *, const char *,
>int);
>extern void statistics_histogram_event (struct function *, const char
>*, int);
>
^ permalink raw reply [flat|nested] 7+ messages in thread
* RE: [PATCH] Print Pass Names
2015-05-22 19:59 ` Richard Biener
@ 2015-05-22 20:55 ` Aditya K
2015-05-22 21:09 ` Jeff Law
0 siblings, 1 reply; 7+ messages in thread
From: Aditya K @ 2015-05-22 20:55 UTC (permalink / raw)
To: Richard Biener, gcc-patches
----------------------------------------
> Subject: Re: [PATCH] Print Pass Names
> From: richard.guenther@gmail.com
> Date: Fri, 22 May 2015 21:32:24 +0200
> To: hiraditya@msn.com; gcc-patches@gcc.gnu.org
>
> On May 22, 2015 6:32:38 PM GMT+02:00, Aditya K <hiraditya@msn.com> wrote:
>>Currently, when we print the passes it does not print its name. This
>>becomes confusing when we want to print all the passes at once (e.g.,
>>-fdump-tree-all-all=stderr &> pass.dump).
>>This patch adds functionality to print the pass name. It passes
>>bootstrap (with default configurations).
>>
>>Hope this is useful.
>
> Can't you just use current_pass->name?
You are right. I have updated the patch.
Thanks
-Aditya
gcc/ChangeLog:
2015-05-22 Aditya Kumar <hiraditya@msn.com>
* statistics.c (statistics_fini_pass): Print pass name.
---
gcc/statistics.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/gcc/statistics.c b/gcc/statistics.c
index 8cbe88d..50b41d1 100644
--- a/gcc/statistics.c
+++ b/gcc/statistics.c
@@ -201,7 +201,7 @@ statistics_fini_pass (void)
&& dump_flags & TDF_STATS)
{
fprintf (dump_file, "\n");
- fprintf (dump_file, "Pass statistics:\n");
+ fprintf (dump_file, "Pass statistics of \"%s\": ", current_pass->name);
fprintf (dump_file, "----------------\n");
curr_statistics_hash ()
->traverse_noresize <void *, statistics_fini_pass_1> (NULL);
--
2.1.0.243.g30d45f7
>
> Richard.
>
>>Thanks,
>>-Aditya
>>
>>
>>gcc/ChangeLog:
>>
>>2015-05-22 Aditya Kumar <hiraditya@msn.com>
>>
>> * passes.c (execute_todo): Added a parameter to pass the pass name.
>> (execute_one_pass): Likewise
>> * statistics.c (statistics_fini_pass): Likewise
>> * statistics.h: Likewise
>>
>>---
>> gcc/passes.c | 9 +++++----
>> gcc/statistics.c | 4 ++--
>> gcc/statistics.h | 2 +-
>> 3 files changed, 8 insertions(+), 7 deletions(-)
>>
>>diff --git a/gcc/passes.c b/gcc/passes.c
>>index 04ff042..7d41bd8 100644
>>--- a/gcc/passes.c
>>+++ b/gcc/passes.c
>>@@ -1984,7 +1984,7 @@ execute_function_todo (function *fn, void *data)
>>
>> /* Perform all TODO actions. */
>> static void
>>-execute_todo (unsigned int flags)
>>+execute_todo (unsigned int flags, const char *pass_name=NULL)
>> {
>> #if defined ENABLE_CHECKING
>> if (cfun
>>@@ -1997,7 +1997,7 @@ execute_todo (unsigned int flags)
>> /* Inform the pass whether it is the first time it is run. */
>> first_pass_instance = (flags & TODO_mark_first_instance) != 0;
>>
>>- statistics_fini_pass ();
>>+ statistics_fini_pass (pass_name);
>>
>> if (flags)
>> do_per_function (execute_function_todo, (void *)(size_t) flags);
>>@@ -2302,7 +2302,7 @@ execute_one_pass (opt_pass *pass)
>> pass_init_dump_file (pass);
>>
>> /* Run pre-pass verification. */
>>- execute_todo (pass->todo_flags_start);
>>+ execute_todo (pass->todo_flags_start, pass->name);
>>
>> #ifdef ENABLE_CHECKING
>> do_per_function (verify_curr_properties,
>>@@ -2327,7 +2327,8 @@ execute_one_pass (opt_pass *pass)
>> check_profile_consistency (pass->static_pass_number, 0, true);
>>
>> /* Run post-pass cleanup and verification. */
>>- execute_todo (todo_after | pass->todo_flags_finish |
>>TODO_verify_il);
>>+ execute_todo (todo_after | pass->todo_flags_finish | TODO_verify_il,
>>+ pass->name);
>> if (profile_report && cfun && (cfun->curr_properties & PROP_cfg))
>> check_profile_consistency (pass->static_pass_number, 1, true);
>>
>>diff --git a/gcc/statistics.c b/gcc/statistics.c
>>index 8cbe88d..54f81d5 100644
>>--- a/gcc/statistics.c
>>+++ b/gcc/statistics.c
>>@@ -192,7 +192,7 @@ statistics_fini_pass_3 (statistics_counter_t
>>**slot,
>> /* Dump the current statistics incrementally. */
>>
>> void
>>-statistics_fini_pass (void)
>>+statistics_fini_pass (const char *pass_name)
>> {
>> if (current_pass->static_pass_number == -1)
>> return;
>>@@ -201,7 +201,7 @@ statistics_fini_pass (void)
>> && dump_flags & TDF_STATS)
>> {
>> fprintf (dump_file, "\n");
>>- fprintf (dump_file, "Pass statistics:\n");
>>+ fprintf (dump_file, "Pass statistics of \"%s\":\n", pass_name);
>> fprintf (dump_file, "----------------\n");
>> curr_statistics_hash ()
>> ->traverse_noresize <void *, statistics_fini_pass_1> (NULL);
>>diff --git a/gcc/statistics.h b/gcc/statistics.h
>>index 0b871ec..4348b7a 100644
>>--- a/gcc/statistics.h
>>+++ b/gcc/statistics.h
>>@@ -64,7 +64,7 @@ struct function;
>> extern void statistics_early_init (void);
>> extern void statistics_init (void);
>> extern void statistics_fini (void);
>>-extern void statistics_fini_pass (void);
>>+extern void statistics_fini_pass (const char *pass_name = NULL);
>>extern void statistics_counter_event (struct function *, const char *,
>>int);
>>extern void statistics_histogram_event (struct function *, const char
>>*, int);
>>
>
>
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] Print Pass Names
2015-05-22 20:55 ` Aditya K
@ 2015-05-22 21:09 ` Jeff Law
2015-05-26 14:51 ` Aditya K
0 siblings, 1 reply; 7+ messages in thread
From: Jeff Law @ 2015-05-22 21:09 UTC (permalink / raw)
To: Aditya K, Richard Biener, gcc-patches
On 05/22/2015 02:38 PM, Aditya K wrote:
>
>
> ----------------------------------------
>> Subject: Re: [PATCH] Print Pass Names
>> From: richard.guenther@gmail.com
>> Date: Fri, 22 May 2015 21:32:24 +0200
>> To: hiraditya@msn.com; gcc-patches@gcc.gnu.org
>>
>> On May 22, 2015 6:32:38 PM GMT+02:00, Aditya K <hiraditya@msn.com> wrote:
>>> Currently, when we print the passes it does not print its name. This
>>> becomes confusing when we want to print all the passes at once (e.g.,
>>> -fdump-tree-all-all=stderr &> pass.dump).
>>> This patch adds functionality to print the pass name. It passes
>>> bootstrap (with default configurations).
>>>
>>> Hope this is useful.
>>
>> Can't you just use current_pass->name?
>
> You are right. I have updated the patch.
> Thanks
> -Aditya
>
> gcc/ChangeLog:
>
> 2015-05-22 Aditya Kumar <hiraditya@msn.com>
>
> * statistics.c (statistics_fini_pass): Print pass name.OK.
jeff
^ permalink raw reply [flat|nested] 7+ messages in thread
* RE: [PATCH] Print Pass Names
2015-05-22 21:09 ` Jeff Law
@ 2015-05-26 14:51 ` Aditya K
2015-05-27 15:25 ` Jeff Law
0 siblings, 1 reply; 7+ messages in thread
From: Aditya K @ 2015-05-26 14:51 UTC (permalink / raw)
To: Jeff Law, Richard Biener, gcc-patches
I don't have commit access. I would appreciate if someone does that for me.
Thanks,
-Aditya
----------------------------------------
> Date: Fri, 22 May 2015 14:52:29 -0600
> From: law@redhat.com
> To: hiraditya@msn.com; richard.guenther@gmail.com; gcc-patches@gcc.gnu.org
> Subject: Re: [PATCH] Print Pass Names
>
> On 05/22/2015 02:38 PM, Aditya K wrote:
>>
>>
>> ----------------------------------------
>>> Subject: Re: [PATCH] Print Pass Names
>>> From: richard.guenther@gmail.com
>>> Date: Fri, 22 May 2015 21:32:24 +0200
>>> To: hiraditya@msn.com; gcc-patches@gcc.gnu.org
>>>
>>> On May 22, 2015 6:32:38 PM GMT+02:00, Aditya K <hiraditya@msn.com> wrote:
>>>> Currently, when we print the passes it does not print its name. This
>>>> becomes confusing when we want to print all the passes at once (e.g.,
>>>> -fdump-tree-all-all=stderr &> pass.dump).
>>>> This patch adds functionality to print the pass name. It passes
>>>> bootstrap (with default configurations).
>>>>
>>>> Hope this is useful.
>>>
>>> Can't you just use current_pass->name?
>>
>> You are right. I have updated the patch.
>> Thanks
>> -Aditya
>>
>> gcc/ChangeLog:
>>
>> 2015-05-22 Aditya Kumar <hiraditya@msn.com>
>>
>> * statistics.c (statistics_fini_pass): Print pass name.OK.
> jeff
>
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] Print Pass Names
2015-05-26 14:51 ` Aditya K
@ 2015-05-27 15:25 ` Jeff Law
2015-05-27 19:58 ` Aditya K
0 siblings, 1 reply; 7+ messages in thread
From: Jeff Law @ 2015-05-27 15:25 UTC (permalink / raw)
To: Aditya K, Richard Biener, gcc-patches
On 05/26/2015 08:32 AM, Aditya K wrote:
> I don't have commit access. I would appreciate if someone does that for me.
>
> Thanks,
> -Aditya
>
> ----------------------------------------
>> Date: Fri, 22 May 2015 14:52:29 -0600
>> From: law@redhat.com
>> To: hiraditya@msn.com; richard.guenther@gmail.com; gcc-patches@gcc.gnu.org
>> Subject: Re: [PATCH] Print Pass Names
>>
>> On 05/22/2015 02:38 PM, Aditya K wrote:
>>>
>>>
>>> ----------------------------------------
>>>> Subject: Re: [PATCH] Print Pass Names
>>>> From: richard.guenther@gmail.com
>>>> Date: Fri, 22 May 2015 21:32:24 +0200
>>>> To: hiraditya@msn.com; gcc-patches@gcc.gnu.org
>>>>
>>>> On May 22, 2015 6:32:38 PM GMT+02:00, Aditya K <hiraditya@msn.com> wrote:
>>>>> Currently, when we print the passes it does not print its name. This
>>>>> becomes confusing when we want to print all the passes at once (e.g.,
>>>>> -fdump-tree-all-all=stderr &> pass.dump).
>>>>> This patch adds functionality to print the pass name. It passes
>>>>> bootstrap (with default configurations).
>>>>>
>>>>> Hope this is useful.
>>>>
>>>> Can't you just use current_pass->name?
>>>
>>> You are right. I have updated the patch.
>>> Thanks
>>> -Aditya
>>>
>>> gcc/ChangeLog:
>>>
>>> 2015-05-22 Aditya Kumar <hiraditya@msn.com>
>>>
>>> * statistics.c (statistics_fini_pass): Print pass name.OK.
>> jeff
>>
>
>
Installed on the trunk after a bootstrap and regression test run on
x86-linux-gnu.
Thanks,
Jeff
^ permalink raw reply [flat|nested] 7+ messages in thread
* RE: [PATCH] Print Pass Names
2015-05-27 15:25 ` Jeff Law
@ 2015-05-27 19:58 ` Aditya K
0 siblings, 0 replies; 7+ messages in thread
From: Aditya K @ 2015-05-27 19:58 UTC (permalink / raw)
To: Jeff Law, Richard Biener, gcc-patches
----------------------------------------
> Date: Wed, 27 May 2015 09:07:30 -0600
> From: law@redhat.com
> To: hiraditya@msn.com; richard.guenther@gmail.com; gcc-patches@gcc.gnu.org
> Subject: Re: [PATCH] Print Pass Names
>
> On 05/26/2015 08:32 AM, Aditya K wrote:
>> I don't have commit access. I would appreciate if someone does that for me.
>>
>> Thanks,
>> -Aditya
>>
>> ----------------------------------------
>>> Date: Fri, 22 May 2015 14:52:29 -0600
>>> From: law@redhat.com
>>> To: hiraditya@msn.com; richard.guenther@gmail.com; gcc-patches@gcc.gnu.org
>>> Subject: Re: [PATCH] Print Pass Names
>>>
>>> On 05/22/2015 02:38 PM, Aditya K wrote:
>>>>
>>>>
>>>> ----------------------------------------
>>>>> Subject: Re: [PATCH] Print Pass Names
>>>>> From: richard.guenther@gmail.com
>>>>> Date: Fri, 22 May 2015 21:32:24 +0200
>>>>> To: hiraditya@msn.com; gcc-patches@gcc.gnu.org
>>>>>
>>>>> On May 22, 2015 6:32:38 PM GMT+02:00, Aditya K <hiraditya@msn.com> wrote:
>>>>>> Currently, when we print the passes it does not print its name. This
>>>>>> becomes confusing when we want to print all the passes at once (e.g.,
>>>>>> -fdump-tree-all-all=stderr &> pass.dump).
>>>>>> This patch adds functionality to print the pass name. It passes
>>>>>> bootstrap (with default configurations).
>>>>>>
>>>>>> Hope this is useful.
>>>>>
>>>>> Can't you just use current_pass->name?
>>>>
>>>> You are right. I have updated the patch.
>>>> Thanks
>>>> -Aditya
>>>>
>>>> gcc/ChangeLog:
>>>>
>>>> 2015-05-22 Aditya Kumar <hiraditya@msn.com>
>>>>
>>>> * statistics.c (statistics_fini_pass): Print pass name.OK.
>>> jeff
>>>
>>
>>
> Installed on the trunk after a bootstrap and regression test run on
> x86-linux-gnu.
Thanks for merging the patches.
-Aditya
>
> Thanks,
> Jeff
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2015-05-27 18:59 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-05-22 17:04 [PATCH] Print Pass Names Aditya K
2015-05-22 19:59 ` Richard Biener
2015-05-22 20:55 ` Aditya K
2015-05-22 21:09 ` Jeff Law
2015-05-26 14:51 ` Aditya K
2015-05-27 15:25 ` Jeff Law
2015-05-27 19:58 ` Aditya K
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).