+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
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)
$(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 \
$(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) \
#include "expr.h"
#include "df.h"
#include "dce.h"
+#include "dbgcnt.h"
#define FORWARDER_BLOCK_P(BB) ((BB)->flags & BB_FORWARDER_BLOCK)
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;
/* 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)
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)
+
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 =
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 =
static bool gate_dse (void);
+static bool gate_dse1 (void);
+static bool gate_dse2 (void);
\f
/*----------------------------------------------------------------------------
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 */
struct tree_opt_pass pass_rtl_dse2 =
{
"dse2", /* name */
- gate_dse, /* gate */
+ gate_dse2, /* gate */
rest_of_handle_dse, /* execute */
NULL, /* sub */
NULL, /* next */
/* 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. */ ;
/* 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)
{
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. */
static bool
gate_handle_gcse (void)
{
- return optimize > 0 && flag_gcse;
+ return optimize > 0 && flag_gcse
+ && dbg_cnt (gcse);
}
#include "df.h"
#include "vec.h"
#include "vecprim.h"
+#include "dbgcnt.h"
#ifndef HAVE_conditional_execution
#define HAVE_conditional_execution 0
static bool
gate_handle_if_conversion (void)
{
- return (optimize > 0);
+ return (optimize > 0)
+ && dbg_cnt (if_conversion);
}
/* If-conversion and CFG cleanup. */
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);
}
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