This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[tree-ssa]: Add timevars for tree optimizers


Diego, thoughts?
Otherwise, this stuff gets thrown in "expand".
2002-10-21  Daniel Berlin  <dberlin@dberlin.org>

	* timevar.def: Add TV_TREE_{PRE,CCP,DCE,CFG,SSA} timevars.

	* tree-optimize.c (optimize_function_tree): Push and pop timevars
	for the tree optimizers.

Index: timevar.def
===================================================================
RCS file: /cvs/gcc/gcc/gcc/timevar.def,v
retrieving revision 1.14
diff -c -3 -p -w -B -b -r1.14 timevar.def
*** timevar.def	1 Jun 2002 21:31:35 -0000	1.14
--- timevar.def	21 Oct 2002 20:09:09 -0000
*************** DEFTIMEVAR (TV_CPP		     , "preprocessin
*** 52,57 ****
--- 52,62 ----
  DEFTIMEVAR (TV_LEX		     , "lexical analysis")
  DEFTIMEVAR (TV_PARSE                 , "parser")
  DEFTIMEVAR (TV_EXPAND		     , "expand")
+ DEFTIMEVAR (TV_TREE_CFG	     , "tree CFG construction")
+ DEFTIMEVAR (TV_TREE_SSA	     , "tree SSA building")	
+ DEFTIMEVAR (TV_TREE_CCP	     , "tree CCP")
+ DEFTIMEVAR (TV_TREE_PRE	     , "tree PRE")
+ DEFTIMEVAR (TV_TREE_DCE	     , "tree DCE")
  DEFTIMEVAR (TV_VARCONST              , "varconst")
  DEFTIMEVAR (TV_INTEGRATION           , "integration")
  DEFTIMEVAR (TV_JUMP                  , "jump")
Index: tree-optimize.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/Attic/tree-optimize.c,v
retrieving revision 1.1.4.17
diff -c -3 -p -w -B -b -r1.1.4.17 tree-optimize.c
*** tree-optimize.c	18 Oct 2002 03:36:39 -0000	1.1.4.17
--- tree-optimize.c	21 Oct 2002 20:09:09 -0000
*************** Boston, MA 02111-1307, USA.  */
*** 33,38 ****
--- 33,39 ----
  #include "flags.h"
  #include "tree-flow.h"
  #include "tree-dchain.h"
+ #include "timevar.h"

  /* Shared functions with tree-cfg.c and tree-ssa.c.  */
  extern void delete_tree_ssa		PARAMS ((tree));
*************** optimize_function_tree (fndecl)
*** 70,90 ****
--- 71,101 ----
    /* Initialize flow data.  */
    init_flow ();

+   timevar_push (TV_TREE_CFG);
    build_tree_cfg (fnbody);
+   timevar_pop (TV_TREE_CFG);

    /* Begin analysis optimization passes.  */
    if (n_basic_blocks > 0 && ! (errorcount || sorrycount))
      {
+       timevar_push (TV_TREE_SSA);
        build_tree_ssa (fndecl);
+       timevar_pop (TV_TREE_SSA);

+       timevar_push (TV_TREE_PRE);
        if (flag_tree_pre)
  	tree_perform_ssapre ();
+       timevar_pop (TV_TREE_PRE);

+       timevar_push (TV_TREE_CCP);
        if (flag_tree_ccp)
  	tree_ssa_ccp (fndecl);
+       timevar_pop (TV_TREE_CCP);

+       timevar_push (TV_TREE_DCE);
        if (flag_tree_dce)
  	tree_ssa_eliminate_dead_code (fndecl);
+       timevar_pop(TV_TREE_DCE);
      }

  #if 0


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]