public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH] Add debug counter for IPA bits CP.
@ 2020-08-11  7:04 Martin Liška
  2020-08-11  9:04 ` Jan Hubicka
  0 siblings, 1 reply; 3+ messages in thread
From: Martin Liška @ 2020-08-11  7:04 UTC (permalink / raw)
  To: gcc-patches

Hey.

I'm debugging PR96482 and it would be handy for me to have a debug counter
for the problematic transformation.

Ready for master?
Thanks,
Martin

gcc/ChangeLog:

	* dbgcnt.def (DEBUG_COUNTER): Add ipa_cp_bits.
	* ipa-cp.c (ipcp_store_bits_results): Use it when we store known
	bits for parameters.
---
  gcc/dbgcnt.def |  1 +
  gcc/ipa-cp.c   | 11 ++++++++---
  2 files changed, 9 insertions(+), 3 deletions(-)

diff --git a/gcc/dbgcnt.def b/gcc/dbgcnt.def
index 3998c9636aa..cf8775b2b66 100644
--- a/gcc/dbgcnt.def
+++ b/gcc/dbgcnt.def
@@ -170,6 +170,7 @@ DEBUG_COUNTER (if_after_combine)
  DEBUG_COUNTER (if_after_reload)
  DEBUG_COUNTER (if_conversion)
  DEBUG_COUNTER (if_conversion_tree)
+DEBUG_COUNTER (ipa_cp_bits)
  DEBUG_COUNTER (ipa_sra_params)
  DEBUG_COUNTER (ipa_sra_retvalues)
  DEBUG_COUNTER (ira_move)
diff --git a/gcc/ipa-cp.c b/gcc/ipa-cp.c
index 10cc59509d5..945a69977f3 100644
--- a/gcc/ipa-cp.c
+++ b/gcc/ipa-cp.c
@@ -123,6 +123,7 @@ along with GCC; see the file COPYING3.  If not see
  #include "tree-ssa-ccp.h"
  #include "stringpool.h"
  #include "attribs.h"
+#include "dbgcnt.h"
  
  template <typename valtype> class ipcp_value;
  
@@ -5788,9 +5789,13 @@ ipcp_store_bits_results (void)
  	  ipa_bits *jfbits;
  
  	  if (plats->bits_lattice.constant_p ())
-	    jfbits
-	      = ipa_get_ipa_bits_for_value (plats->bits_lattice.get_value (),
-					    plats->bits_lattice.get_mask ());
+	    {
+	      jfbits
+		= ipa_get_ipa_bits_for_value (plats->bits_lattice.get_value (),
+					      plats->bits_lattice.get_mask ());
+	      if (!dbg_cnt (ipa_cp_bits))
+		jfbits = NULL;
+	    }
  	  else
  	    jfbits = NULL;
  
-- 
2.28.0


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

* Re: [PATCH] Add debug counter for IPA bits CP.
  2020-08-11  7:04 [PATCH] Add debug counter for IPA bits CP Martin Liška
@ 2020-08-11  9:04 ` Jan Hubicka
  2020-08-11  9:50   ` Martin Liška
  0 siblings, 1 reply; 3+ messages in thread
From: Jan Hubicka @ 2020-08-11  9:04 UTC (permalink / raw)
  To: Martin Liška; +Cc: gcc-patches

> Hey.
> 
> I'm debugging PR96482 and it would be handy for me to have a debug counter
> for the problematic transformation.
> 
> Ready for master?

Looks good to me.  Perhaps it would be more systematic to add them to
the remaining propagators as well - bugs tends to pop up from time to
time related to those.

Honza
> Thanks,
> Martin
> 
> gcc/ChangeLog:
> 
> 	* dbgcnt.def (DEBUG_COUNTER): Add ipa_cp_bits.
> 	* ipa-cp.c (ipcp_store_bits_results): Use it when we store known
> 	bits for parameters.
> ---
>  gcc/dbgcnt.def |  1 +
>  gcc/ipa-cp.c   | 11 ++++++++---
>  2 files changed, 9 insertions(+), 3 deletions(-)
> 
> diff --git a/gcc/dbgcnt.def b/gcc/dbgcnt.def
> index 3998c9636aa..cf8775b2b66 100644
> --- a/gcc/dbgcnt.def
> +++ b/gcc/dbgcnt.def
> @@ -170,6 +170,7 @@ DEBUG_COUNTER (if_after_combine)
>  DEBUG_COUNTER (if_after_reload)
>  DEBUG_COUNTER (if_conversion)
>  DEBUG_COUNTER (if_conversion_tree)
> +DEBUG_COUNTER (ipa_cp_bits)
>  DEBUG_COUNTER (ipa_sra_params)
>  DEBUG_COUNTER (ipa_sra_retvalues)
>  DEBUG_COUNTER (ira_move)
> diff --git a/gcc/ipa-cp.c b/gcc/ipa-cp.c
> index 10cc59509d5..945a69977f3 100644
> --- a/gcc/ipa-cp.c
> +++ b/gcc/ipa-cp.c
> @@ -123,6 +123,7 @@ along with GCC; see the file COPYING3.  If not see
>  #include "tree-ssa-ccp.h"
>  #include "stringpool.h"
>  #include "attribs.h"
> +#include "dbgcnt.h"
>  template <typename valtype> class ipcp_value;
> @@ -5788,9 +5789,13 @@ ipcp_store_bits_results (void)
>  	  ipa_bits *jfbits;
>  	  if (plats->bits_lattice.constant_p ())
> -	    jfbits
> -	      = ipa_get_ipa_bits_for_value (plats->bits_lattice.get_value (),
> -					    plats->bits_lattice.get_mask ());
> +	    {
> +	      jfbits
> +		= ipa_get_ipa_bits_for_value (plats->bits_lattice.get_value (),
> +					      plats->bits_lattice.get_mask ());
> +	      if (!dbg_cnt (ipa_cp_bits))
> +		jfbits = NULL;
> +	    }
>  	  else
>  	    jfbits = NULL;
> -- 
> 2.28.0
> 

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

* Re: [PATCH] Add debug counter for IPA bits CP.
  2020-08-11  9:04 ` Jan Hubicka
@ 2020-08-11  9:50   ` Martin Liška
  0 siblings, 0 replies; 3+ messages in thread
From: Martin Liška @ 2020-08-11  9:50 UTC (permalink / raw)
  To: Jan Hubicka; +Cc: gcc-patches, Martin Jambor

On 8/11/20 11:04 AM, Jan Hubicka wrote:
> Looks good to me.  Perhaps it would be more systematic to add them to
> the remaining propagators as well - bugs tends to pop up from time to
> time related to those.

Works for me.
@Martin: Can you please add them?

Thanks,
Martin

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

end of thread, other threads:[~2020-08-11  9:50 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-08-11  7:04 [PATCH] Add debug counter for IPA bits CP Martin Liška
2020-08-11  9:04 ` Jan Hubicka
2020-08-11  9:50   ` 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).