This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[patch] Create timevar for dominance info recomputation
- From: Zdenek Dvorak <rakdver at atrey dot karlin dot mff dot cuni dot cz>
- To: gcc-patches at gcc dot gnu dot org
- Date: Fri, 14 Apr 2006 11:58:55 +0200
- Subject: [patch] Create timevar for dominance info recomputation
Hello,
currently, dominance info recomputation is run on the time of whatever
pass calls it; this is not quite fair, as the recomputation is done on
demand, so the pass asking for it usually is not the one that
invalidated the dominance information. This patch creates a separate
timevar for calculate_dominance_info. Boostrapped & regtested on ia64.
Zdenek
* dominance.c: Include timevar.h.
(calculate_dominance_info): Use TV_DOMINANCE.
* timevar.def (TV_DOMINANCE): New timevar.
* Makefile.in (dominance.o): Add TIMEVAR_H dependency.
Index: dominance.c
===================================================================
*** dominance.c (revision 112911)
--- dominance.c (working copy)
***************
*** 43,48 ****
--- 43,49 ----
#include "basic-block.h"
#include "toplev.h"
#include "et-forest.h"
+ #include "timevar.h"
/* Whether the dominators and the postdominators are available. */
enum dom_state dom_computed[2];
*************** calculate_dominance_info (enum cdi_direc
*** 616,621 ****
--- 617,623 ----
if (dom_computed[dir] == DOM_OK)
return;
+ timevar_push (TV_DOMINANCE);
if (!dom_info_available_p (dir))
{
gcc_assert (!n_bbs_in_dom_tree[dir]);
*************** calculate_dominance_info (enum cdi_direc
*** 643,648 ****
--- 645,652 ----
}
compute_dom_fast_query (dir);
+
+ timevar_pop (TV_DOMINANCE);
}
/* Free dominance information for direction DIR. */
Index: timevar.def
===================================================================
*** timevar.def (revision 112911)
--- timevar.def (working copy)
*************** DEFTIMEVAR (TV_TREE_SSA_VERIFY , "
*** 121,126 ****
--- 121,127 ----
DEFTIMEVAR (TV_TREE_STMT_VERIFY , "tree STMT verifier")
DEFTIMEVAR (TV_CGRAPH_VERIFY , "callgraph verifier")
DEFTIMEVAR (TV_DOM_FRONTIERS , "dominance frontiers")
+ DEFTIMEVAR (TV_DOMINANCE , "dominance computation")
DEFTIMEVAR (TV_CONTROL_DEPENDENCES , "control dependences")
DEFTIMEVAR (TV_OVERLOAD , "overload resolution")
DEFTIMEVAR (TV_TEMPLATE_INSTANTIATION, "template instantiation")
Index: Makefile.in
===================================================================
*** Makefile.in (revision 112911)
--- Makefile.in (working copy)
*************** loop-unroll.o: loop-unroll.c $(CONFIG_H)
*** 2439,2445 ****
output.h $(EXPR_H) coretypes.h $(TM_H) $(HASHTAB_H) $(RECOG_H) \
$(OBSTACK_H)
dominance.o : dominance.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) \
! hard-reg-set.h $(BASIC_BLOCK_H) et-forest.h $(OBSTACK_H) toplev.h
et-forest.o : et-forest.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \
et-forest.h alloc-pool.h $(BASIC_BLOCK_H)
combine.o : combine.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) \
--- 2439,2445 ----
output.h $(EXPR_H) coretypes.h $(TM_H) $(HASHTAB_H) $(RECOG_H) \
$(OBSTACK_H)
dominance.o : dominance.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) \
! hard-reg-set.h $(BASIC_BLOCK_H) et-forest.h $(OBSTACK_H) toplev.h $(TIMEVAR_H)
et-forest.o : et-forest.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \
et-forest.h alloc-pool.h $(BASIC_BLOCK_H)
combine.o : combine.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) \