diff mbox series

[5/6] ipa-cp: Add dumping of overall_size after cloning

Message ID bb1a73874a6c9a8a59e9c1532b517f52513d980e.1601403165.git.mjambor@suse.cz
State New
Headers show
Series IPA cleanups and IPA-CP improvements for 548.exchange2_r | expand

Commit Message

Martin Jambor Sept. 21, 2020, 2:25 p.m. UTC
When experimenting with IPA-CP parameters, especially when looking
into exchange2_r, it has been very useful to know what the value of
overall_size is at different stages of the decision process.  This
patch therefore adds it to the generated dumps.

gcc/ChangeLog:

2020-09-07  Martin Jambor  <mjambor@suse.cz>

	* ipa-cp.c (estimate_local_effects): Add overeall_size to dumped
	string.
	(decide_about_value): Add dumping new overall_size.
---
 gcc/ipa-cp.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

Comments

Jan Hubicka Sept. 29, 2020, 6:39 p.m. UTC | #1
> When experimenting with IPA-CP parameters, especially when looking
> into exchange2_r, it has been very useful to know what the value of
> overall_size is at different stages of the decision process.  This
> patch therefore adds it to the generated dumps.
> 
> gcc/ChangeLog:
> 
> 2020-09-07  Martin Jambor  <mjambor@suse.cz>
> 
> 	* ipa-cp.c (estimate_local_effects): Add overeall_size to dumped
> 	string.
> 	(decide_about_value): Add dumping new overall_size.
OK,
thanks
Honza
> ---
>  gcc/ipa-cp.c | 6 +++++-
>  1 file changed, 5 insertions(+), 1 deletion(-)
> 
> diff --git a/gcc/ipa-cp.c b/gcc/ipa-cp.c
> index f6320c787de..12acf24c553 100644
> --- a/gcc/ipa-cp.c
> +++ b/gcc/ipa-cp.c
> @@ -3517,7 +3517,8 @@ estimate_local_effects (struct cgraph_node *node)
>  
>  	      if (dump_file)
>  		fprintf (dump_file, "     Decided to specialize for all "
> -			 "known contexts, growth deemed beneficial.\n");
> +			 "known contexts, growth (to %li) deemed "
> +			 "beneficial.\n", overall_size);
>  	    }
>  	  else if (dump_file && (dump_flags & TDF_DETAILS))
>  	    fprintf (dump_file, "  Not cloning for all contexts because "
> @@ -5506,6 +5507,9 @@ decide_about_value (struct cgraph_node *node, int index, HOST_WIDE_INT offset,
>    val->spec_node = create_specialized_node (node, known_csts, known_contexts,
>  					    aggvals, callers);
>    overall_size += val->local_size_cost;
> +  if (dump_file && (dump_flags & TDF_DETAILS))
> +    fprintf (dump_file, "     overall size reached %li\n",
> +	     overall_size);
>  
>    /* TODO: If for some lattice there is only one other known value
>       left, make a special node for it too. */
> -- 
> 2.28.0
>
diff mbox series

Patch

diff --git a/gcc/ipa-cp.c b/gcc/ipa-cp.c
index f6320c787de..12acf24c553 100644
--- a/gcc/ipa-cp.c
+++ b/gcc/ipa-cp.c
@@ -3517,7 +3517,8 @@  estimate_local_effects (struct cgraph_node *node)
 
 	      if (dump_file)
 		fprintf (dump_file, "     Decided to specialize for all "
-			 "known contexts, growth deemed beneficial.\n");
+			 "known contexts, growth (to %li) deemed "
+			 "beneficial.\n", overall_size);
 	    }
 	  else if (dump_file && (dump_flags & TDF_DETAILS))
 	    fprintf (dump_file, "  Not cloning for all contexts because "
@@ -5506,6 +5507,9 @@  decide_about_value (struct cgraph_node *node, int index, HOST_WIDE_INT offset,
   val->spec_node = create_specialized_node (node, known_csts, known_contexts,
 					    aggvals, callers);
   overall_size += val->local_size_cost;
+  if (dump_file && (dump_flags & TDF_DETAILS))
+    fprintf (dump_file, "     overall size reached %li\n",
+	     overall_size);
 
   /* TODO: If for some lattice there is only one other known value
      left, make a special node for it too. */