timevars tweek

Jan Hubicka jh@suse.cz
Sun Jul 15 13:08:00 GMT 2001


Hi,
this patch adds new timevars for find_basic_blocks and cfg_cleanup so
we can measure these separately and see if the new code is not source
of noticeable slowdown.

At the moment, I've measured 2% of time in find_basic_blocks and 6% in
cfg_cleanup after jump pass is killed.  This is less than original
jump consumed overall, but still I would like to see it lower.

Patch also adds missing dependencies in Makefile.

Bootstrapped/regtested i686 together with other today patches.

Honza

Ne čec 15 22:01:48 CEST 2001  Jan Hubicka  <jh@suse.cz>
	* flow.c: Include timevar.h
	(find_basic_block): Push/pop timevar;
	(cleanup_cfg): Likewise.
	* timevar.def (TV_CFG, TV_CLEANUP_CFG): New.
	* Makefile: Add dependencies on timevar.h

*** /p1/jumpr2/jumpr/egcs/gcc/flow.c	Sat Jul 14 22:05:38 2001
--- flow.c	Sun Jul 15 21:05:09 2001
*************** Boston, MA 02111-1307, USA.  */
*** 136,141 ****
--- 136,142 ----
  #include "expr.h"
  #include "ssa.h"
  #include "cselib.h"
+ #include "timevar.h"
  
  #include "obstack.h"
  #include "splay-tree.h"
*************** find_basic_blocks (f, nregs, file)
*** 503,508 ****
--- 504,510 ----
       FILE *file ATTRIBUTE_UNUSED;
  {
    int max_uid;
+   timevar_push (TV_CFG);
  
    /* Flush out existing data.  */
    if (basic_block_info != NULL)
*************** find_basic_blocks (f, nregs, file)
*** 560,565 ****
--- 562,568 ----
  #ifdef ENABLE_CHECKING
    verify_flow_info ();
  #endif
+   timevar_pop (TV_CFG);
  }
  
  void
*************** void
*** 1006,1011 ****
--- 1009,1015 ----
  cleanup_cfg (mode)
       int mode;
  {
+   timevar_push (TV_CLEANUP_CFG);
    delete_unreachable_blocks ();
    if (try_optimize_cfg (mode))
      delete_unreachable_blocks ();
*************** cleanup_cfg (mode)
*** 1014,1019 ****
--- 1018,1024 ----
    /* Kill the data we won't maintain.  */
    free_EXPR_LIST_list (&label_value_list);
    free_EXPR_LIST_list (&tail_recursion_label_list);
+   timevar_pop (TV_CLEANUP_CFG);
  }
  
  /* Create a new basic block consisting of the instructions between
*** /p1/jumpr2/jumpr/egcs/gcc/Makefile	Fri Jul 13 22:49:59 2001
--- Makefile	Sun Jul 15 19:44:27 2001
*************** c-errors.o: c-errors.c $(CONFIG_H) $(SYS
*** 2532,2538 ****
      diagnostic.h $(TM_P_H)
  c-parse.o : $(srcdir)/c-parse.c $(CONFIG_H) $(TREE_H) c-lex.h $(GGC_H) intl.h \
      $(C_TREE_H) input.h flags.h $(SYSTEM_H) toplev.h output.h cpplib.h \
!     diagnostic.h
  	$(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) -c $(srcdir)/c-parse.c
  
  $(srcdir)/c-parse.c: $(srcdir)/c-parse.y
--- 2532,2538 ----
      diagnostic.h $(TM_P_H)
  c-parse.o : $(srcdir)/c-parse.c $(CONFIG_H) $(TREE_H) c-lex.h $(GGC_H) intl.h \
      $(C_TREE_H) input.h flags.h $(SYSTEM_H) toplev.h output.h cpplib.h \
!     diagnostic.h $(TIMEVAR_H)
  	$(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) -c $(srcdir)/c-parse.c
  
  $(srcdir)/c-parse.c: $(srcdir)/c-parse.y
*************** c-lang.o : c-lang.c $(CONFIG_H) $(SYSTEM
*** 2556,2562 ****
  c-lex.o : c-lex.c $(CONFIG_H) $(SYSTEM_H) $(TREE_H) $(RTL_H) c-lex.h \
      debug.h $(C_TREE_H) \
      c-pragma.h input.h intl.h flags.h toplev.h output.h \
!     mbchar.h cpplib.h $(EXPR_H) $(TM_P_H)
  c-aux-info.o : c-aux-info.c  $(CONFIG_H) $(SYSTEM_H) $(TREE_H) $(C_TREE_H) \
      flags.h toplev.h
  c-convert.o : c-convert.c $(CONFIG_H) $(SYSTEM_H) $(TREE_H) flags.h toplev.h
--- 2556,2562 ----
  c-lex.o : c-lex.c $(CONFIG_H) $(SYSTEM_H) $(TREE_H) $(RTL_H) c-lex.h \
      debug.h $(C_TREE_H) \
      c-pragma.h input.h intl.h flags.h toplev.h output.h \
!     mbchar.h cpplib.h $(EXPR_H) $(TM_P_H) $(TIMEVAR_H)
  c-aux-info.o : c-aux-info.c  $(CONFIG_H) $(SYSTEM_H) $(TREE_H) $(C_TREE_H) \
      flags.h toplev.h
  c-convert.o : c-convert.c $(CONFIG_H) $(SYSTEM_H) $(TREE_H) flags.h toplev.h
*************** c-format.o : c-format.c $(CONFIG_H) $(SY
*** 2635,2641 ****
  
  c-semantics.o : c-semantics.c $(CONFIG_H) $(SYSTEM_H) $(TREE_H) $(C_TREE_H) \
  	c-lex.h flags.h toplev.h output.h c-pragma.h $(RTL_H) $(GGC_H) \
! 	$(EXPR_H)
  
  c-dump.o: c-dump.c $(CONFIG_H) $(SYSTEM_H) $(TREE_H) $(C_TREE_H) \
  	c-lex.h flags.h toplev.h output.h c-pragma.h $(RTL_H) $(GGC_H) \
--- 2635,2641 ----
  
  c-semantics.o : c-semantics.c $(CONFIG_H) $(SYSTEM_H) $(TREE_H) $(C_TREE_H) \
  	c-lex.h flags.h toplev.h output.h c-pragma.h $(RTL_H) $(GGC_H) \
! 	$(EXPR_H) $(TIMEVAR_H)
  
  c-dump.o: c-dump.c $(CONFIG_H) $(SYSTEM_H) $(TREE_H) $(C_TREE_H) \
  	c-lex.h flags.h toplev.h output.h c-pragma.h $(RTL_H) $(GGC_H) \
*************** ggc-common.o: ggc-common.c $(CONFIG_H) $
*** 2693,2702 ****
  	flags.h $(GGC_H) varray.h hash.h $(TM_P_H)
  
  ggc-simple.o: ggc-simple.c $(CONFIG_H) $(SYSTEM_H) $(RTL_H) $(TREE_H) flags.h \
! 	$(GGC_H) varray.h $(TIMEVAR_H) $(TM_P_H)
  
  ggc-page.o: ggc-page.c $(CONFIG_H) $(SYSTEM_H) $(RTL_H) $(TREE_H) flags.h \
! 	toplev.h $(GGC_H) varray.h $(TIMEVAR_H) $(TM_P_H)
  
  stringpool.o: stringpool.c $(CONFIG_H) $(SYSTEM_H) $(TREE_H) $(OBSTACK_H) \
  	flags.h toplev.h
--- 2693,2702 ----
  	flags.h $(GGC_H) varray.h hash.h $(TM_P_H)
  
  ggc-simple.o: ggc-simple.c $(CONFIG_H) $(SYSTEM_H) $(RTL_H) $(TREE_H) flags.h \
! 	$(GGC_H) varray.h $(TIMEVAR_H) $(TM_P_H) $(TIMEVAR_H)
  
  ggc-page.o: ggc-page.c $(CONFIG_H) $(SYSTEM_H) $(RTL_H) $(TREE_H) flags.h \
! 	toplev.h $(GGC_H) varray.h $(TIMEVAR_H) $(TM_P_H) $(TIMEVAR_H)
  
  stringpool.o: stringpool.c $(CONFIG_H) $(SYSTEM_H) $(TREE_H) $(OBSTACK_H) \
  	flags.h toplev.h
*************** unroll.o : unroll.c $(CONFIG_H) $(SYSTEM
*** 2860,2866 ****
     hard-reg-set.h varray.h $(BASIC_BLOCK_H) $(TM_P_H) $(PREDICT_H)
  flow.o : flow.c $(CONFIG_H) $(SYSTEM_H) $(RTL_H) $(TREE_H) flags.h insn-config.h \
     $(BASIC_BLOCK_H) $(REGS_H) hard-reg-set.h output.h toplev.h $(RECOG_H) \
!    function.h except.h $(EXPR_H) ssa.h $(GGC_H) $(TM_P_H)
  dominance.o : dominance.c $(CONFIG_H) $(SYSTEM_H) $(RTL_H) hard-reg-set.h \
     $(BASIC_BLOCK_H)
  combine.o : combine.c $(CONFIG_H) $(SYSTEM_H) $(RTL_H) flags.h function.h \
--- 2860,2866 ----
     hard-reg-set.h varray.h $(BASIC_BLOCK_H) $(TM_P_H) $(PREDICT_H)
  flow.o : flow.c $(CONFIG_H) $(SYSTEM_H) $(RTL_H) $(TREE_H) flags.h insn-config.h \
     $(BASIC_BLOCK_H) $(REGS_H) hard-reg-set.h output.h toplev.h $(RECOG_H) \
!    function.h except.h $(EXPR_H) ssa.h $(GGC_H) $(TM_P_H) $(TIMEVAR_H)
  dominance.o : dominance.c $(CONFIG_H) $(SYSTEM_H) $(RTL_H) hard-reg-set.h \
     $(BASIC_BLOCK_H)
  combine.o : combine.c $(CONFIG_H) $(SYSTEM_H) $(RTL_H) flags.h function.h \
*** /p1/jumpr2/jumpr/egcs/gcc/timevar.def	Thu Jul 12 18:03:44 2001
--- timevar.def	Sun Jul 15 19:39:49 2001
*************** DEFTIMEVAR (TV_GC                    , "
*** 39,44 ****
--- 39,48 ----
  /* Time spent generating dump files.  */
  DEFTIMEVAR (TV_DUMP                  , "dump files")
  
+ /* Time spent by constructing CFG.  */
+ DEFTIMEVAR (TV_CFG                   , "cfg construction")
+ /* Time spent by cleaning up CFG.  */
+ DEFTIMEVAR (TV_CLEANUP_CFG           , "cfg cleanup")
  /* Timing in various stages of the compiler.  */
  DEFTIMEVAR (TV_CPP		     , "preprocessing")
  DEFTIMEVAR (TV_LEX		     , "lexical analysis")



More information about the Gcc-patches mailing list