Patchwork Use a debug counter in SRA

login
register
mail settings
Submitter Martin Jambor
Date June 10, 2010, 10:41 a.m.
Message ID <20100610104127.GB29266@virgil.suse.cz>
Download mbox | patch
Permalink /patch/55198/
State New
Headers show

Comments

Martin Jambor - June 10, 2010, 10:41 a.m.
Hi,

the patch below adds a debug counter check to the gate of the SRAs for
better debugging and even bi-secting problems by users.

Bootstrapped and tested on x86_64-linux.  OK for trunk?

Thanks,

Martin


2010-06-10  Martin Jambor  <mjambor@suse.cz>

	* Makefile.in (tree-sra.o): Add DBGCNT_H to dependencies.
	* dbgcnt.def (tree_sra): New counter.
	* tree-sra.c: Include dbgcnt.h.
	(gate_intra_sra): Check tree_sra debug counter.
Richard Guenther - June 10, 2010, 10:43 a.m.
On Thu, 10 Jun 2010, Martin Jambor wrote:

> Hi,
> 
> the patch below adds a debug counter check to the gate of the SRAs for
> better debugging and even bi-secting problems by users.
> 
> Bootstrapped and tested on x86_64-linux.  OK for trunk?

Ok.

Thanks,
Richard.

> Thanks,
> 
> Martin
> 
> 
> 2010-06-10  Martin Jambor  <mjambor@suse.cz>
> 
> 	* Makefile.in (tree-sra.o): Add DBGCNT_H to dependencies.
> 	* dbgcnt.def (tree_sra): New counter.
> 	* tree-sra.c: Include dbgcnt.h.
> 	(gate_intra_sra): Check tree_sra debug counter.
> 
> Index: mine/gcc/Makefile.in
> ===================================================================
> --- mine.orig/gcc/Makefile.in
> +++ mine/gcc/Makefile.in
> @@ -3112,7 +3112,7 @@ tree-ssa-ccp.o : tree-ssa-ccp.c $(TREE_F
>  tree-sra.o : tree-sra.c $(CONFIG_H) $(SYSTEM_H) coretypes.h alloc-pool.h \
>     $(TM_H) $(TREE_H) $(GIMPLE_H) $(CGRAPH_H) $(TREE_FLOW_H) $(IPA_PROP_H) \
>     $(DIAGNOSTIC_H) statistics.h $(TREE_DUMP_H) $(TIMEVAR_H) $(PARAMS_H) \
> -   $(TARGET_H) $(FLAGS_H) $(EXPR_H) tree-pretty-print.h
> +   $(TARGET_H) $(FLAGS_H) $(EXPR_H) tree-pretty-print.h $(DBGCNT_H)
>  tree-switch-conversion.o : tree-switch-conversion.c $(CONFIG_H) $(SYSTEM_H) \
>      $(TREE_H) $(TM_P_H) $(TREE_FLOW_H) $(DIAGNOSTIC_H) $(TREE_INLINE_H) \
>      $(TIMEVAR_H) $(TM_H) coretypes.h $(TREE_DUMP_H) $(GIMPLE_H) \
> Index: mine/gcc/dbgcnt.def
> ===================================================================
> --- mine.orig/gcc/dbgcnt.def
> +++ mine/gcc/dbgcnt.def
> @@ -167,6 +167,7 @@ DEBUG_COUNTER (postreload_cse)
>  DEBUG_COUNTER (pre)
>  DEBUG_COUNTER (pre_insn)
>  DEBUG_COUNTER (treepre_insert)
> +DEBUG_COUNTER (tree_sra)
>  DEBUG_COUNTER (sched2_func)
>  DEBUG_COUNTER (sched_block)
>  DEBUG_COUNTER (sched_func)
> Index: mine/gcc/tree-sra.c
> ===================================================================
> --- mine.orig/gcc/tree-sra.c
> +++ mine/gcc/tree-sra.c
> @@ -88,6 +88,7 @@ along with GCC; see the file COPYING3.
>  #include "params.h"
>  #include "target.h"
>  #include "flags.h"
> +#include "dbgcnt.h"
>  
>  /* Enumeration of all aggregate reductions we can do.  */
>  enum sra_mode { SRA_MODE_EARLY_IPA,   /* early call regularization */
> @@ -2936,7 +2937,7 @@ late_intra_sra (void)
>  static bool
>  gate_intra_sra (void)
>  {
> -  return flag_tree_sra != 0;
> +  return flag_tree_sra != 0 && dbg_cnt (tree_sra);
>  }
>  
>  
> 
>

Patch

Index: mine/gcc/Makefile.in
===================================================================
--- mine.orig/gcc/Makefile.in
+++ mine/gcc/Makefile.in
@@ -3112,7 +3112,7 @@  tree-ssa-ccp.o : tree-ssa-ccp.c $(TREE_F
 tree-sra.o : tree-sra.c $(CONFIG_H) $(SYSTEM_H) coretypes.h alloc-pool.h \
    $(TM_H) $(TREE_H) $(GIMPLE_H) $(CGRAPH_H) $(TREE_FLOW_H) $(IPA_PROP_H) \
    $(DIAGNOSTIC_H) statistics.h $(TREE_DUMP_H) $(TIMEVAR_H) $(PARAMS_H) \
-   $(TARGET_H) $(FLAGS_H) $(EXPR_H) tree-pretty-print.h
+   $(TARGET_H) $(FLAGS_H) $(EXPR_H) tree-pretty-print.h $(DBGCNT_H)
 tree-switch-conversion.o : tree-switch-conversion.c $(CONFIG_H) $(SYSTEM_H) \
     $(TREE_H) $(TM_P_H) $(TREE_FLOW_H) $(DIAGNOSTIC_H) $(TREE_INLINE_H) \
     $(TIMEVAR_H) $(TM_H) coretypes.h $(TREE_DUMP_H) $(GIMPLE_H) \
Index: mine/gcc/dbgcnt.def
===================================================================
--- mine.orig/gcc/dbgcnt.def
+++ mine/gcc/dbgcnt.def
@@ -167,6 +167,7 @@  DEBUG_COUNTER (postreload_cse)
 DEBUG_COUNTER (pre)
 DEBUG_COUNTER (pre_insn)
 DEBUG_COUNTER (treepre_insert)
+DEBUG_COUNTER (tree_sra)
 DEBUG_COUNTER (sched2_func)
 DEBUG_COUNTER (sched_block)
 DEBUG_COUNTER (sched_func)
Index: mine/gcc/tree-sra.c
===================================================================
--- mine.orig/gcc/tree-sra.c
+++ mine/gcc/tree-sra.c
@@ -88,6 +88,7 @@  along with GCC; see the file COPYING3.
 #include "params.h"
 #include "target.h"
 #include "flags.h"
+#include "dbgcnt.h"
 
 /* Enumeration of all aggregate reductions we can do.  */
 enum sra_mode { SRA_MODE_EARLY_IPA,   /* early call regularization */
@@ -2936,7 +2937,7 @@  late_intra_sra (void)
 static bool
 gate_intra_sra (void)
 {
-  return flag_tree_sra != 0;
+  return flag_tree_sra != 0 && dbg_cnt (tree_sra);
 }