public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH] Clean-up IPA profile dump output.
@ 2018-01-23  9:32 Martin Liška
  2018-01-23 10:02 ` Jan Hubicka
  0 siblings, 1 reply; 3+ messages in thread
From: Martin Liška @ 2018-01-23  9:32 UTC (permalink / raw)
  To: gcc-patches; +Cc: Jan Hubicka

[-- Attachment #1: Type: text/plain, Size: 612 bytes --]

Hi.

I'm aware in which development stage we are. However the patch is small and makes
dump files readable. Hope such patch can be accepted even now?

Patch can bootstrap on ppc64le-redhat-linux and survives regression tests.

Martin

gcc/ChangeLog:

2018-01-22  Martin Liska  <mliska@suse.cz>

	* tree-profile.c (tree_profiling): Print function header to
	aware reader which function we are working on.
	* value-prof.c (gimple_find_values_to_profile): Do not print
	not interesting value histograms.
---
 gcc/tree-profile.c | 4 ++++
 gcc/value-prof.c   | 2 +-
 2 files changed, 5 insertions(+), 1 deletion(-)



[-- Attachment #2: 0001-Clean-up-IPA-profile-dump-output.patch --]
[-- Type: text/x-patch, Size: 1164 bytes --]

diff --git a/gcc/tree-profile.c b/gcc/tree-profile.c
index 9d919062db1..f96bd4b9704 100644
--- a/gcc/tree-profile.c
+++ b/gcc/tree-profile.c
@@ -52,6 +52,7 @@ along with GCC; see the file COPYING3.  If not see
 #include "params.h"
 #include "stringpool.h"
 #include "attribs.h"
+#include "tree-pretty-print.h"
 
 static GTY(()) tree gcov_type_node;
 static GTY(()) tree tree_interval_profiler_fn;
@@ -671,6 +672,9 @@ tree_profiling (void)
 
       push_cfun (DECL_STRUCT_FUNCTION (node->decl));
 
+      if (dump_file)
+	dump_function_header (dump_file, cfun->decl, dump_flags);
+
       /* Local pure-const may imply need to fixup the cfg.  */
       if (execute_fixup_cfg () & TODO_cleanup_cfg)
 	cleanup_tree_cfg ();
diff --git a/gcc/value-prof.c b/gcc/value-prof.c
index b503320f188..16cdbd64f46 100644
--- a/gcc/value-prof.c
+++ b/gcc/value-prof.c
@@ -2053,7 +2053,7 @@ gimple_find_values_to_profile (histogram_values *values)
 	default:
 	  gcc_unreachable ();
 	}
-      if (dump_file)
+      if (dump_file && hist->hvalue.stmt != NULL)
         {
 	  fprintf (dump_file, "Stmt ");
           print_gimple_stmt (dump_file, hist->hvalue.stmt, 0, TDF_SLIM);


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

* Re: [PATCH] Clean-up IPA profile dump output.
  2018-01-23  9:32 [PATCH] Clean-up IPA profile dump output Martin Liška
@ 2018-01-23 10:02 ` Jan Hubicka
  2018-01-23 12:55   ` Martin Liška
  0 siblings, 1 reply; 3+ messages in thread
From: Jan Hubicka @ 2018-01-23 10:02 UTC (permalink / raw)
  To: Martin Liška; +Cc: gcc-patches

> Hi.
> 
> I'm aware in which development stage we are. However the patch is small and makes
> dump files readable. Hope such patch can be accepted even now?
> 
> Patch can bootstrap on ppc64le-redhat-linux and survives regression tests.
> 
> Martin
> 
> gcc/ChangeLog:
> 
> 2018-01-22  Martin Liska  <mliska@suse.cz>
> 
> 	* tree-profile.c (tree_profiling): Print function header to
> 	aware reader which function we are working on.
> 	* value-prof.c (gimple_find_values_to_profile): Do not print
> 	not interesting value histograms.

OK.  How those non-interesting value histograms arrise?

Honza
> ---
>  gcc/tree-profile.c | 4 ++++
>  gcc/value-prof.c   | 2 +-
>  2 files changed, 5 insertions(+), 1 deletion(-)
> 
> 

> diff --git a/gcc/tree-profile.c b/gcc/tree-profile.c
> index 9d919062db1..f96bd4b9704 100644
> --- a/gcc/tree-profile.c
> +++ b/gcc/tree-profile.c
> @@ -52,6 +52,7 @@ along with GCC; see the file COPYING3.  If not see
>  #include "params.h"
>  #include "stringpool.h"
>  #include "attribs.h"
> +#include "tree-pretty-print.h"
>  
>  static GTY(()) tree gcov_type_node;
>  static GTY(()) tree tree_interval_profiler_fn;
> @@ -671,6 +672,9 @@ tree_profiling (void)
>  
>        push_cfun (DECL_STRUCT_FUNCTION (node->decl));
>  
> +      if (dump_file)
> +	dump_function_header (dump_file, cfun->decl, dump_flags);
> +
>        /* Local pure-const may imply need to fixup the cfg.  */
>        if (execute_fixup_cfg () & TODO_cleanup_cfg)
>  	cleanup_tree_cfg ();
> diff --git a/gcc/value-prof.c b/gcc/value-prof.c
> index b503320f188..16cdbd64f46 100644
> --- a/gcc/value-prof.c
> +++ b/gcc/value-prof.c
> @@ -2053,7 +2053,7 @@ gimple_find_values_to_profile (histogram_values *values)
>  	default:
>  	  gcc_unreachable ();
>  	}
> -      if (dump_file)
> +      if (dump_file && hist->hvalue.stmt != NULL)
>          {
>  	  fprintf (dump_file, "Stmt ");
>            print_gimple_stmt (dump_file, hist->hvalue.stmt, 0, TDF_SLIM);
> 

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

* Re: [PATCH] Clean-up IPA profile dump output.
  2018-01-23 10:02 ` Jan Hubicka
@ 2018-01-23 12:55   ` Martin Liška
  0 siblings, 0 replies; 3+ messages in thread
From: Martin Liška @ 2018-01-23 12:55 UTC (permalink / raw)
  To: Jan Hubicka; +Cc: gcc-patches

On 01/23/2018 10:43 AM, Jan Hubicka wrote:
>> Hi.
>>
>> I'm aware in which development stage we are. However the patch is small and makes
>> dump files readable. Hope such patch can be accepted even now?
>>
>> Patch can bootstrap on ppc64le-redhat-linux and survives regression tests.
>>
>> Martin
>>
>> gcc/ChangeLog:
>>
>> 2018-01-22  Martin Liska  <mliska@suse.cz>
>>
>> 	* tree-profile.c (tree_profiling): Print function header to
>> 	aware reader which function we are working on.
>> 	* value-prof.c (gimple_find_values_to_profile): Do not print
>> 	not interesting value histograms.
> 
> OK.  How those non-interesting value histograms arrise?

Can happen if you have missing profile, then no value histograms are loaded.

Thanks for review, let me install it.
Martin

> 
> Honza
>> ---
>>  gcc/tree-profile.c | 4 ++++
>>  gcc/value-prof.c   | 2 +-
>>  2 files changed, 5 insertions(+), 1 deletion(-)
>>
>>
> 
>> diff --git a/gcc/tree-profile.c b/gcc/tree-profile.c
>> index 9d919062db1..f96bd4b9704 100644
>> --- a/gcc/tree-profile.c
>> +++ b/gcc/tree-profile.c
>> @@ -52,6 +52,7 @@ along with GCC; see the file COPYING3.  If not see
>>  #include "params.h"
>>  #include "stringpool.h"
>>  #include "attribs.h"
>> +#include "tree-pretty-print.h"
>>  
>>  static GTY(()) tree gcov_type_node;
>>  static GTY(()) tree tree_interval_profiler_fn;
>> @@ -671,6 +672,9 @@ tree_profiling (void)
>>  
>>        push_cfun (DECL_STRUCT_FUNCTION (node->decl));
>>  
>> +      if (dump_file)
>> +	dump_function_header (dump_file, cfun->decl, dump_flags);
>> +
>>        /* Local pure-const may imply need to fixup the cfg.  */
>>        if (execute_fixup_cfg () & TODO_cleanup_cfg)
>>  	cleanup_tree_cfg ();
>> diff --git a/gcc/value-prof.c b/gcc/value-prof.c
>> index b503320f188..16cdbd64f46 100644
>> --- a/gcc/value-prof.c
>> +++ b/gcc/value-prof.c
>> @@ -2053,7 +2053,7 @@ gimple_find_values_to_profile (histogram_values *values)
>>  	default:
>>  	  gcc_unreachable ();
>>  	}
>> -      if (dump_file)
>> +      if (dump_file && hist->hvalue.stmt != NULL)
>>          {
>>  	  fprintf (dump_file, "Stmt ");
>>            print_gimple_stmt (dump_file, hist->hvalue.stmt, 0, TDF_SLIM);
>>
> 

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

end of thread, other threads:[~2018-01-23 12:20 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-01-23  9:32 [PATCH] Clean-up IPA profile dump output Martin Liška
2018-01-23 10:02 ` Jan Hubicka
2018-01-23 12:55   ` Martin Liška

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).