diff options
author | dje <dje@138bc75d-0d04-0410-961f-82ee72b054a4> | 2008-02-26 19:21:21 +0000 |
---|---|---|
committer | dje <dje@138bc75d-0d04-0410-961f-82ee72b054a4> | 2008-02-26 19:21:21 +0000 |
commit | 4ff06051cbabbe8e197187acd87a3c1ba139aed4 (patch) | |
tree | d3d1d41238e71fa67b722a736ee63be9e08201fe /gcc | |
parent | 0fc88469ed193c14e05072b3435063f8e11d7d2f (diff) | |
download | gcc-4ff06051cbabbe8e197187acd87a3c1ba139aed4.tar.gz |
* 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.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@132684 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ChangeLog | 19 | ||||
-rw-r--r-- | gcc/Makefile.in | 6 | ||||
-rw-r--r-- | gcc/cfgcleanup.c | 4 | ||||
-rw-r--r-- | gcc/dbgcnt.def | 19 | ||||
-rw-r--r-- | gcc/dce.c | 6 | ||||
-rw-r--r-- | gcc/dse.c | 22 | ||||
-rw-r--r-- | gcc/gcse.c | 33 | ||||
-rw-r--r-- | gcc/ifcvt.c | 10 |
8 files changed, 93 insertions, 26 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 2a6f2030a3e..6177658033f 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,22 @@ +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> * config/rs6000/rs6000.c (processor_costs): Update e300 cache diff --git a/gcc/Makefile.in b/gcc/Makefile.in index 34ad39509cc..49ba245b2ad 100644 --- a/gcc/Makefile.in +++ b/gcc/Makefile.in @@ -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 \ 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) \ - $(DF_H) $(DBGCNT_H) + $(DF_H) $(DBGCNT_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 \ $(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) \ $(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) \ $(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) \ $(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 \ @@ -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) \ $(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 \ - $(DF_H) + $(DF_H) $(DBGCNT_H) lambda-mat.o : lambda-mat.c $(LAMBDA_H) $(GGC_H) $(SYSTEM_H) $(CONFIG_H) \ $(TM_H) coretypes.h $(TREE_H) lambda-trans.o: lambda-trans.c $(LAMBDA_H) $(GGC_H) $(SYSTEM_H) $(CONFIG_H) \ diff --git a/gcc/cfgcleanup.c b/gcc/cfgcleanup.c index 3ec7d3f3781..f030eabca62 100644 --- a/gcc/cfgcleanup.c +++ b/gcc/cfgcleanup.c @@ -55,6 +55,7 @@ along with GCC; see the file COPYING3. If not see #include "expr.h" #include "df.h" #include "dce.h" +#include "dbgcnt.h" #define FORWARDER_BLOCK_P(BB) ((BB)->flags & BB_FORWARDER_BLOCK) @@ -2250,6 +2251,9 @@ cleanup_cfg (int mode) if (mode & CLEANUP_CROSSJUMP) add_noreturn_fake_exit_edges (); + if (!dbg_cnt (cfg_cleanup)) + return changed; + while (try_optimize_cfg (mode)) { delete_unreachable_blocks (), changed = true; diff --git a/gcc/dbgcnt.def b/gcc/dbgcnt.def index 18ef8a7dc55..b2382f167e3 100644 --- a/gcc/dbgcnt.def +++ b/gcc/dbgcnt.def @@ -65,12 +65,26 @@ along with GCC; see the file COPYING3. If not see /* Debug counter definitions. */ DEBUG_COUNTER (auto_inc_dec) +DEBUG_COUNTER (cfg_cleanup) DEBUG_COUNTER (cse2_move2add) +DEBUG_COUNTER (cprop1) +DEBUG_COUNTER (cprop2) DEBUG_COUNTER (dce) +DEBUG_COUNTER (dce_fast) +DEBUG_COUNTER (dce_ud) DEBUG_COUNTER (delete_trivial_dead) DEBUG_COUNTER (dse) +DEBUG_COUNTER (dse1) +DEBUG_COUNTER (dse2) +DEBUG_COUNTER (gcse) DEBUG_COUNTER (gcse2_delete) +DEBUG_COUNTER (global_alloc_at_func) +DEBUG_COUNTER (global_alloc_at_reg) 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 (postreload_cse) DEBUG_COUNTER (pre_insn) @@ -79,8 +93,7 @@ DEBUG_COUNTER (sched_block) DEBUG_COUNTER (sched_func) DEBUG_COUNTER (sched_insn) DEBUG_COUNTER (sched_region) +DEBUG_COUNTER (sms_sched_loop) DEBUG_COUNTER (split_for_sched2) DEBUG_COUNTER (tail_call) -DEBUG_COUNTER (global_alloc_at_func) -DEBUG_COUNTER (global_alloc_at_reg) -DEBUG_COUNTER (sms_sched_loop) + diff --git a/gcc/dce.c b/gcc/dce.c index e63a07a9ef4..70b9e226514 100644 --- a/gcc/dce.c +++ b/gcc/dce.c @@ -563,7 +563,8 @@ rest_of_handle_ud_dce (void) static bool 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 = @@ -848,7 +849,8 @@ run_fast_dce (void) static bool 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 = diff --git a/gcc/dse.c b/gcc/dse.c index 2b860187fbe..48df3503b6f 100644 --- a/gcc/dse.c +++ b/gcc/dse.c @@ -540,6 +540,8 @@ static unsigned int current_position; static bool gate_dse (void); +static bool gate_dse1 (void); +static bool gate_dse2 (void); /*---------------------------------------------------------------------------- @@ -3284,13 +3286,27 @@ rest_of_handle_dse (void) static bool 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 = { "dse1", /* name */ - gate_dse, /* gate */ + gate_dse1, /* gate */ rest_of_handle_dse, /* execute */ NULL, /* sub */ NULL, /* next */ @@ -3309,7 +3325,7 @@ struct tree_opt_pass pass_rtl_dse1 = struct tree_opt_pass pass_rtl_dse2 = { "dse2", /* name */ - gate_dse, /* gate */ + gate_dse2, /* gate */ rest_of_handle_dse, /* execute */ NULL, /* sub */ NULL, /* next */ diff --git a/gcc/gcse.c b/gcc/gcse.c index 8cb5d386702..c9c8b4c32b3 100644 --- a/gcc/gcse.c +++ b/gcc/gcse.c @@ -718,9 +718,12 @@ gcse_main (rtx f ATTRIBUTE_UNUSED) /* Don't allow constant propagation to modify jumps during this pass. */ - timevar_push (TV_CPROP1); - changed = one_cprop_pass (pass + 1, false, false); - timevar_pop (TV_CPROP1); + if (dbg_cnt (cprop1)) + { + timevar_push (TV_CPROP1); + changed = one_cprop_pass (pass + 1, false, false); + timevar_pop (TV_CPROP1); + } if (optimize_size) /* Do nothing. */ ; @@ -783,13 +786,17 @@ gcse_main (rtx f ATTRIBUTE_UNUSED) /* Do one last pass of copy propagation, including cprop into conditional jumps. */ - max_gcse_regno = max_reg_num (); - alloc_gcse_mem (); - /* This time, go ahead and allow cprop to alter jumps. */ - timevar_push (TV_CPROP2); - one_cprop_pass (pass + 1, true, true); - timevar_pop (TV_CPROP2); - free_gcse_mem (); + if (dbg_cnt (cprop2)) + { + max_gcse_regno = max_reg_num (); + alloc_gcse_mem (); + + /* This time, go ahead and allow cprop to alter jumps. */ + timevar_push (TV_CPROP2); + one_cprop_pass (pass + 1, true, true); + timevar_pop (TV_CPROP2); + free_gcse_mem (); + } if (dump_file) { @@ -6666,7 +6673,8 @@ is_too_expensive (const char *pass) static bool 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. */ @@ -6705,7 +6713,8 @@ struct tree_opt_pass pass_jump_bypass = static bool gate_handle_gcse (void) { - return optimize > 0 && flag_gcse; + return optimize > 0 && flag_gcse + && dbg_cnt (gcse); } diff --git a/gcc/ifcvt.c b/gcc/ifcvt.c index 549c0995768..1bb67321d2b 100644 --- a/gcc/ifcvt.c +++ b/gcc/ifcvt.c @@ -45,6 +45,7 @@ #include "df.h" #include "vec.h" #include "vecprim.h" +#include "dbgcnt.h" #ifndef HAVE_conditional_execution #define HAVE_conditional_execution 0 @@ -4109,7 +4110,8 @@ if_convert (void) static bool gate_handle_if_conversion (void) { - return (optimize > 0); + return (optimize > 0) + && dbg_cnt (if_conversion); } /* If-conversion and CFG cleanup. */ @@ -4149,7 +4151,8 @@ struct tree_opt_pass pass_rtl_ifcvt = static bool 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 = static bool 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 |