Commit 7d817ebc by David Edelsohn Committed by David Edelsohn

dbgcnt.def (cfg_cleanup, [...]): New counters.

        * dbgcnt.def (cfg_cleanup, cprop1, cprop2, dce_fast, dce_ud, dse1,
        dse2, gcse, if_conversion, if_after_combine, if_after_reload,
        jump_bypass): New counters.
        * cfgcleanup.c (cleanup_cfg): Add dbg_cnt.
        * dce.c (gate_ud_dce): Same.
        (gate_fast_dce): Same.
        * dse.c (gate_dse1): New function.
        (gate_dse2): New function.
        (gate_dse): Merge results of new gate functions.
        * gcse.c (gcse_main): Bracket cprop1 and cprop2 with dbg_cnt.
        (gate_handle_jump_bypass): Add dbg_cnt.
        (gate_handle_gcse): Add dbg_cnt.
        * ifcvt.c (gate_handle_if_conversion): Same.
        (gate_handle_if_after_combine): Same.
        (gate_handle_if_after_reload): Same.
        * Makefile.in: Add DBGCNT_H to cfgcleanup.o and ifcvt.o.

From-SVN: r132684
parent a19b7d46
2008-02-26 David Edelsohn <edelsohn@gnu.org>
* dbgcnt.def (cfg_cleanup, cprop1, cprop2, dce_fast, dce_ud, dse1,
dse2, gcse, if_conversion, if_after_combine, if_after_reload,
jump_bypass): New counters.
* cfgcleanup.c (cleanup_cfg): Add dbg_cnt.
* dce.c (gate_ud_dce): Same.
(gate_fast_dce): Same.
* dse.c (gate_dse1): New function.
(gate_dse2): New function.
(gate_dse): Merge results of new gate functions.
* gcse.c (gcse_main): Bracket cprop1 and cprop2 with dbg_cnt.
(gate_handle_jump_bypass): Add dbg_cnt.
(gate_handle_gcse): Add dbg_cnt.
* ifcvt.c (gate_handle_if_conversion): Same.
(gate_handle_if_after_combine): Same.
(gate_handle_if_after_reload): Same.
* Makefile.in: Add DBGCNT_H to cfgcleanup.o and ifcvt.o.
2008-02-26 Edmar Wienskoski <edmar@freescale.com> 2008-02-26 Edmar Wienskoski <edmar@freescale.com>
* config/rs6000/rs6000.c (processor_costs): Update e300 cache * config/rs6000/rs6000.c (processor_costs): Update e300 cache
......
...@@ -2540,7 +2540,7 @@ cse.o : cse.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) $(REGS_H) \ ...@@ -2540,7 +2540,7 @@ cse.o : cse.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) $(REGS_H) \
hard-reg-set.h $(FLAGS_H) insn-config.h $(RECOG_H) $(EXPR_H) toplev.h \ hard-reg-set.h $(FLAGS_H) insn-config.h $(RECOG_H) $(EXPR_H) toplev.h \
output.h $(FUNCTION_H) $(BASIC_BLOCK_H) $(GGC_H) $(TM_P_H) $(TIMEVAR_H) \ output.h $(FUNCTION_H) $(BASIC_BLOCK_H) $(GGC_H) $(TM_P_H) $(TIMEVAR_H) \
except.h $(TARGET_H) $(PARAMS_H) rtlhooks-def.h tree-pass.h $(REAL_H) \ except.h $(TARGET_H) $(PARAMS_H) rtlhooks-def.h tree-pass.h $(REAL_H) \
$(DF_H) $(DBGCNT_H) $(DF_H) $(DBGCNT_H)
dce.o : dce.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) \ dce.o : dce.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) \
$(TREE_H) $(REGS_H) hard-reg-set.h $(FLAGS_H) $(DF_H) cselib.h \ $(TREE_H) $(REGS_H) hard-reg-set.h $(FLAGS_H) $(DF_H) cselib.h \
$(DBGCNT_H) dce.h timevar.h tree-pass.h $(DBGCNT_H) $(DBGCNT_H) dce.h timevar.h tree-pass.h $(DBGCNT_H)
...@@ -2661,7 +2661,7 @@ cfgcleanup.o : cfgcleanup.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \ ...@@ -2661,7 +2661,7 @@ cfgcleanup.o : cfgcleanup.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \
$(RTL_H) $(TIMEVAR_H) hard-reg-set.h output.h $(FLAGS_H) $(RECOG_H) \ $(RTL_H) $(TIMEVAR_H) hard-reg-set.h output.h $(FLAGS_H) $(RECOG_H) \
toplev.h insn-config.h cselib.h $(TARGET_H) $(TM_P_H) $(PARAMS_H) \ toplev.h insn-config.h cselib.h $(TARGET_H) $(TM_P_H) $(PARAMS_H) \
$(REGS_H) $(EMIT_RTL_H) $(CFGLAYOUT_H) tree-pass.h $(CFGLOOP_H) $(EXPR_H) \ $(REGS_H) $(EMIT_RTL_H) $(CFGLAYOUT_H) tree-pass.h $(CFGLOOP_H) $(EXPR_H) \
$(DF_H) $(DF_H) $(DBGCNT_H)
cfgloop.o : cfgloop.c $(CONFIG_H) $(SYSTEM_H) $(RTL_H) coretypes.h $(TM_H) \ cfgloop.o : cfgloop.c $(CONFIG_H) $(SYSTEM_H) $(RTL_H) coretypes.h $(TM_H) \
$(BASIC_BLOCK_H) hard-reg-set.h $(CFGLOOP_H) $(FLAGS_H) $(FUNCTION_H) \ $(BASIC_BLOCK_H) hard-reg-set.h $(CFGLOOP_H) $(FLAGS_H) $(FUNCTION_H) \
$(OBSTACK_H) toplev.h $(TREE_FLOW_H) $(TREE_H) pointer-set.h output.h \ $(OBSTACK_H) toplev.h $(TREE_FLOW_H) $(TREE_H) pointer-set.h output.h \
...@@ -2860,7 +2860,7 @@ ifcvt.o : ifcvt.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) \ ...@@ -2860,7 +2860,7 @@ ifcvt.o : ifcvt.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) \
$(REGS_H) toplev.h $(FLAGS_H) insn-config.h $(FUNCTION_H) $(RECOG_H) \ $(REGS_H) toplev.h $(FLAGS_H) insn-config.h $(FUNCTION_H) $(RECOG_H) \
$(TARGET_H) $(BASIC_BLOCK_H) $(EXPR_H) output.h except.h $(TM_P_H) \ $(TARGET_H) $(BASIC_BLOCK_H) $(EXPR_H) output.h except.h $(TM_P_H) \
$(REAL_H) $(OPTABS_H) $(CFGLOOP_H) hard-reg-set.h $(TIMEVAR_H) tree-pass.h \ $(REAL_H) $(OPTABS_H) $(CFGLOOP_H) hard-reg-set.h $(TIMEVAR_H) tree-pass.h \
$(DF_H) $(DF_H) $(DBGCNT_H)
lambda-mat.o : lambda-mat.c $(LAMBDA_H) $(GGC_H) $(SYSTEM_H) $(CONFIG_H) \ lambda-mat.o : lambda-mat.c $(LAMBDA_H) $(GGC_H) $(SYSTEM_H) $(CONFIG_H) \
$(TM_H) coretypes.h $(TREE_H) $(TM_H) coretypes.h $(TREE_H)
lambda-trans.o: lambda-trans.c $(LAMBDA_H) $(GGC_H) $(SYSTEM_H) $(CONFIG_H) \ lambda-trans.o: lambda-trans.c $(LAMBDA_H) $(GGC_H) $(SYSTEM_H) $(CONFIG_H) \
......
...@@ -55,6 +55,7 @@ along with GCC; see the file COPYING3. If not see ...@@ -55,6 +55,7 @@ along with GCC; see the file COPYING3. If not see
#include "expr.h" #include "expr.h"
#include "df.h" #include "df.h"
#include "dce.h" #include "dce.h"
#include "dbgcnt.h"
#define FORWARDER_BLOCK_P(BB) ((BB)->flags & BB_FORWARDER_BLOCK) #define FORWARDER_BLOCK_P(BB) ((BB)->flags & BB_FORWARDER_BLOCK)
...@@ -2250,6 +2251,9 @@ cleanup_cfg (int mode) ...@@ -2250,6 +2251,9 @@ cleanup_cfg (int mode)
if (mode & CLEANUP_CROSSJUMP) if (mode & CLEANUP_CROSSJUMP)
add_noreturn_fake_exit_edges (); add_noreturn_fake_exit_edges ();
if (!dbg_cnt (cfg_cleanup))
return changed;
while (try_optimize_cfg (mode)) while (try_optimize_cfg (mode))
{ {
delete_unreachable_blocks (), changed = true; delete_unreachable_blocks (), changed = true;
......
...@@ -65,12 +65,26 @@ along with GCC; see the file COPYING3. If not see ...@@ -65,12 +65,26 @@ along with GCC; see the file COPYING3. If not see
/* Debug counter definitions. */ /* Debug counter definitions. */
DEBUG_COUNTER (auto_inc_dec) DEBUG_COUNTER (auto_inc_dec)
DEBUG_COUNTER (cfg_cleanup)
DEBUG_COUNTER (cse2_move2add) DEBUG_COUNTER (cse2_move2add)
DEBUG_COUNTER (cprop1)
DEBUG_COUNTER (cprop2)
DEBUG_COUNTER (dce) DEBUG_COUNTER (dce)
DEBUG_COUNTER (dce_fast)
DEBUG_COUNTER (dce_ud)
DEBUG_COUNTER (delete_trivial_dead) DEBUG_COUNTER (delete_trivial_dead)
DEBUG_COUNTER (dse) DEBUG_COUNTER (dse)
DEBUG_COUNTER (dse1)
DEBUG_COUNTER (dse2)
DEBUG_COUNTER (gcse)
DEBUG_COUNTER (gcse2_delete) DEBUG_COUNTER (gcse2_delete)
DEBUG_COUNTER (global_alloc_at_func)
DEBUG_COUNTER (global_alloc_at_reg)
DEBUG_COUNTER (ia64_sched2) DEBUG_COUNTER (ia64_sched2)
DEBUG_COUNTER (if_conversion)
DEBUG_COUNTER (if_after_combine)
DEBUG_COUNTER (if_after_reload)
DEBUG_COUNTER (jump_bypass)
DEBUG_COUNTER (local_alloc_for_sched) DEBUG_COUNTER (local_alloc_for_sched)
DEBUG_COUNTER (postreload_cse) DEBUG_COUNTER (postreload_cse)
DEBUG_COUNTER (pre_insn) DEBUG_COUNTER (pre_insn)
...@@ -79,8 +93,7 @@ DEBUG_COUNTER (sched_block) ...@@ -79,8 +93,7 @@ DEBUG_COUNTER (sched_block)
DEBUG_COUNTER (sched_func) DEBUG_COUNTER (sched_func)
DEBUG_COUNTER (sched_insn) DEBUG_COUNTER (sched_insn)
DEBUG_COUNTER (sched_region) DEBUG_COUNTER (sched_region)
DEBUG_COUNTER (sms_sched_loop)
DEBUG_COUNTER (split_for_sched2) DEBUG_COUNTER (split_for_sched2)
DEBUG_COUNTER (tail_call) DEBUG_COUNTER (tail_call)
DEBUG_COUNTER (global_alloc_at_func)
DEBUG_COUNTER (global_alloc_at_reg)
DEBUG_COUNTER (sms_sched_loop)
...@@ -563,7 +563,8 @@ rest_of_handle_ud_dce (void) ...@@ -563,7 +563,8 @@ rest_of_handle_ud_dce (void)
static bool static bool
gate_ud_dce (void) gate_ud_dce (void)
{ {
return optimize > 1 && flag_dce; return optimize > 1 && flag_dce
&& dbg_cnt (dce_ud);
} }
struct tree_opt_pass pass_ud_rtl_dce = struct tree_opt_pass pass_ud_rtl_dce =
...@@ -848,7 +849,8 @@ run_fast_dce (void) ...@@ -848,7 +849,8 @@ run_fast_dce (void)
static bool static bool
gate_fast_dce (void) gate_fast_dce (void)
{ {
return optimize > 0 && flag_dce; return optimize > 0 && flag_dce
&& dbg_cnt (dce_fast);
} }
struct tree_opt_pass pass_fast_rtl_dce = struct tree_opt_pass pass_fast_rtl_dce =
......
...@@ -540,6 +540,8 @@ static unsigned int current_position; ...@@ -540,6 +540,8 @@ static unsigned int current_position;
static bool gate_dse (void); static bool gate_dse (void);
static bool gate_dse1 (void);
static bool gate_dse2 (void);
/*---------------------------------------------------------------------------- /*----------------------------------------------------------------------------
...@@ -3284,13 +3286,27 @@ rest_of_handle_dse (void) ...@@ -3284,13 +3286,27 @@ rest_of_handle_dse (void)
static bool static bool
gate_dse (void) gate_dse (void)
{ {
return optimize > 0 && flag_dse; return gate_dse1 () || gate_dse2 ();
}
static bool
gate_dse1 (void)
{
return optimize > 0 && flag_dse
&& dbg_cnt (dse1);
}
static bool
gate_dse2 (void)
{
return optimize > 0 && flag_dse
&& dbg_cnt (dse2);
} }
struct tree_opt_pass pass_rtl_dse1 = struct tree_opt_pass pass_rtl_dse1 =
{ {
"dse1", /* name */ "dse1", /* name */
gate_dse, /* gate */ gate_dse1, /* gate */
rest_of_handle_dse, /* execute */ rest_of_handle_dse, /* execute */
NULL, /* sub */ NULL, /* sub */
NULL, /* next */ NULL, /* next */
...@@ -3309,7 +3325,7 @@ struct tree_opt_pass pass_rtl_dse1 = ...@@ -3309,7 +3325,7 @@ struct tree_opt_pass pass_rtl_dse1 =
struct tree_opt_pass pass_rtl_dse2 = struct tree_opt_pass pass_rtl_dse2 =
{ {
"dse2", /* name */ "dse2", /* name */
gate_dse, /* gate */ gate_dse2, /* gate */
rest_of_handle_dse, /* execute */ rest_of_handle_dse, /* execute */
NULL, /* sub */ NULL, /* sub */
NULL, /* next */ NULL, /* next */
......
...@@ -718,9 +718,12 @@ gcse_main (rtx f ATTRIBUTE_UNUSED) ...@@ -718,9 +718,12 @@ gcse_main (rtx f ATTRIBUTE_UNUSED)
/* Don't allow constant propagation to modify jumps /* Don't allow constant propagation to modify jumps
during this pass. */ during this pass. */
timevar_push (TV_CPROP1); if (dbg_cnt (cprop1))
changed = one_cprop_pass (pass + 1, false, false); {
timevar_pop (TV_CPROP1); timevar_push (TV_CPROP1);
changed = one_cprop_pass (pass + 1, false, false);
timevar_pop (TV_CPROP1);
}
if (optimize_size) if (optimize_size)
/* Do nothing. */ ; /* Do nothing. */ ;
...@@ -783,13 +786,17 @@ gcse_main (rtx f ATTRIBUTE_UNUSED) ...@@ -783,13 +786,17 @@ gcse_main (rtx f ATTRIBUTE_UNUSED)
/* Do one last pass of copy propagation, including cprop into /* Do one last pass of copy propagation, including cprop into
conditional jumps. */ conditional jumps. */
max_gcse_regno = max_reg_num (); if (dbg_cnt (cprop2))
alloc_gcse_mem (); {
/* This time, go ahead and allow cprop to alter jumps. */ max_gcse_regno = max_reg_num ();
timevar_push (TV_CPROP2); alloc_gcse_mem ();
one_cprop_pass (pass + 1, true, true);
timevar_pop (TV_CPROP2); /* This time, go ahead and allow cprop to alter jumps. */
free_gcse_mem (); timevar_push (TV_CPROP2);
one_cprop_pass (pass + 1, true, true);
timevar_pop (TV_CPROP2);
free_gcse_mem ();
}
if (dump_file) if (dump_file)
{ {
...@@ -6666,7 +6673,8 @@ is_too_expensive (const char *pass) ...@@ -6666,7 +6673,8 @@ is_too_expensive (const char *pass)
static bool static bool
gate_handle_jump_bypass (void) gate_handle_jump_bypass (void)
{ {
return optimize > 0 && flag_gcse; return optimize > 0 && flag_gcse
&& dbg_cnt (jump_bypass);
} }
/* Perform jump bypassing and control flow optimizations. */ /* Perform jump bypassing and control flow optimizations. */
...@@ -6705,7 +6713,8 @@ struct tree_opt_pass pass_jump_bypass = ...@@ -6705,7 +6713,8 @@ struct tree_opt_pass pass_jump_bypass =
static bool static bool
gate_handle_gcse (void) gate_handle_gcse (void)
{ {
return optimize > 0 && flag_gcse; return optimize > 0 && flag_gcse
&& dbg_cnt (gcse);
} }
......
...@@ -45,6 +45,7 @@ ...@@ -45,6 +45,7 @@
#include "df.h" #include "df.h"
#include "vec.h" #include "vec.h"
#include "vecprim.h" #include "vecprim.h"
#include "dbgcnt.h"
#ifndef HAVE_conditional_execution #ifndef HAVE_conditional_execution
#define HAVE_conditional_execution 0 #define HAVE_conditional_execution 0
...@@ -4109,7 +4110,8 @@ if_convert (void) ...@@ -4109,7 +4110,8 @@ if_convert (void)
static bool static bool
gate_handle_if_conversion (void) gate_handle_if_conversion (void)
{ {
return (optimize > 0); return (optimize > 0)
&& dbg_cnt (if_conversion);
} }
/* If-conversion and CFG cleanup. */ /* If-conversion and CFG cleanup. */
...@@ -4149,7 +4151,8 @@ struct tree_opt_pass pass_rtl_ifcvt = ...@@ -4149,7 +4151,8 @@ struct tree_opt_pass pass_rtl_ifcvt =
static bool static bool
gate_handle_if_after_combine (void) gate_handle_if_after_combine (void)
{ {
return (optimize > 0 && flag_if_conversion); return optimize > 0 && flag_if_conversion
&& dbg_cnt (if_after_combine);
} }
...@@ -4185,7 +4188,8 @@ struct tree_opt_pass pass_if_after_combine = ...@@ -4185,7 +4188,8 @@ struct tree_opt_pass pass_if_after_combine =
static bool static bool
gate_handle_if_after_reload (void) gate_handle_if_after_reload (void)
{ {
return (optimize > 0 && flag_if_conversion2); return optimize > 0 && flag_if_conversion2
&& dbg_cnt (if_after_reload);
} }
static unsigned int static unsigned int
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment