From 0f3ce272a995a861a987e24b2355a02a124ad51f Mon Sep 17 00:00:00 2001 From: Michael Beck Date: Mon, 3 Apr 2006 13:19:03 +0000 Subject: [PATCH] opt reasons updated fixed iro-numbers for pseuso-ops: must not interfere with numbers used in irp [r7567] --- ir/stat/const_stat.c | 1 + ir/stat/firmstat.c | 26 ++++++++++++++------------ ir/stat/firmstat.h | 3 ++- ir/stat/stat_dmp.c | 6 +++++- 4 files changed, 22 insertions(+), 14 deletions(-) diff --git a/ir/stat/const_stat.c b/ir/stat/const_stat.c index 8b5c4f439..9409e423d 100644 --- a/ir/stat/const_stat.c +++ b/ir/stat/const_stat.c @@ -77,6 +77,7 @@ const char *stat_fc_name(float_classify_t classification) /** * update info on Consts * + * @param status statistic status * @param node The Const node * @param graph The graph entry containing the call */ diff --git a/ir/stat/firmstat.c b/ir/stat/firmstat.c index 530bec4eb..9d1781f5f 100644 --- a/ir/stat/firmstat.c +++ b/ir/stat/firmstat.c @@ -711,7 +711,7 @@ static void update_node_stat_2(ir_node *node, void *env) graph_entry_t *graph = env; /* check for properties that depends on calls like recursion/leaf/indirect call */ - if (get_irn_op(node) == op_Call) + if (is_Call(node)) stat_update_call_2(node, graph); } @@ -1608,11 +1608,12 @@ void stat_dump_snapshot(const char *name, const char *phase) static hook_entry_t stat_hooks[hook_last]; /* initialize the statistics module. */ -void init_stat(unsigned enable_options) +void firm_init_stat(unsigned enable_options) { #define X(a) a, sizeof(a)-1 #define HOOK(h, fkt) \ stat_hooks[h].hook._##h = fkt; register_hook(h, &stat_hooks[h]) + unsigned num = 0; if (! (enable_options & FIRMSTAT_ENABLED)) return; @@ -1656,25 +1657,26 @@ void init_stat(unsigned enable_options) if (enable_options & FIRMSTAT_COUNT_STRONG_OP) { /* build the pseudo-ops */ - _op_Phi0.code = get_next_ir_opcode(); + + _op_Phi0.code = --num; _op_Phi0.name = new_id_from_chars(X("Phi0")); - _op_PhiM.code = get_next_ir_opcode(); + _op_PhiM.code = --num; _op_PhiM.name = new_id_from_chars(X("PhiM")); - _op_ProjM.code = get_next_ir_opcode(); + _op_ProjM.code = --num; _op_ProjM.name = new_id_from_chars(X("ProjM")); - _op_MulC.code = get_next_ir_opcode(); + _op_MulC.code = --num; _op_MulC.name = new_id_from_chars(X("MulC")); - _op_DivC.code = get_next_ir_opcode(); + _op_DivC.code = --num; _op_DivC.name = new_id_from_chars(X("DivC")); - _op_ModC.code = get_next_ir_opcode(); + _op_ModC.code = --num; _op_ModC.name = new_id_from_chars(X("ModC")); - _op_DivModC.code = get_next_ir_opcode(); + _op_DivModC.code = --num; _op_DivModC.name = new_id_from_chars(X("DivModC")); status->op_Phi0 = &_op_Phi0; @@ -1696,10 +1698,10 @@ void init_stat(unsigned enable_options) } if (enable_options & FIRMSTAT_COUNT_SELS) { - _op_SelSel.code = get_next_ir_opcode(); + _op_SelSel.code = --num; _op_SelSel.name = new_id_from_chars(X("Sel(Sel)")); - _op_SelSelSel.code = get_next_ir_opcode(); + _op_SelSelSel.code = --num; _op_SelSelSel.name = new_id_from_chars(X("Sel(Sel(Sel))")); status->op_SelSel = &_op_SelSel; @@ -1738,7 +1740,7 @@ void stat_term(void) { #else /* initialize the statistics module. */ -void init_stat(unsigned enable_options) {} +void firm_init_stat(unsigned enable_options) {} /* Dumps a statistics snapshot */ void stat_dump_snapshot(const char *name, const char *phase) {} diff --git a/ir/stat/firmstat.h b/ir/stat/firmstat.h index 11b582841..9c45764cf 100644 --- a/ir/stat/firmstat.h +++ b/ir/stat/firmstat.h @@ -65,6 +65,7 @@ enum firmstat_optimizations_t { FS_OPT_MUX_TO_MAX, /**< Mux(a > b, a, b) = Max(a,b) */ FS_OPT_MUX_TO_ABS, /**< Mux(a > b, a, b) = Abs(a,b) */ FS_OPT_MUX_TO_SHR, /**< Mux(a > b, a, b) = a >> b */ + FS_BE_IA32_LEA, /**< Lea was created */ FS_OPT_MAX }; @@ -82,7 +83,7 @@ void stat_dump_snapshot(const char *name, const char *phase); * * @param enable_options a bitmask containing the statistic options */ -void init_stat(unsigned enable_options); +void firm_init_stat(unsigned enable_options); /** * terminates the statistics module, frees all memory diff --git a/ir/stat/stat_dmp.c b/ir/stat/stat_dmp.c index 96b1215f4..3f7847ba9 100644 --- a/ir/stat/stat_dmp.c +++ b/ir/stat/stat_dmp.c @@ -28,6 +28,7 @@ static const struct { { HOOK_OPT_CONST_EVAL, "constant evaluation" }, { HOOK_OPT_ALGSIM, "algebraic simplification" }, { HOOK_OPT_PHI, "Phi optmization" }, + { HOOK_OPT_SYNC, "Sync optmization" }, { HOOK_OPT_WAW, "Write-After-Write optimization" }, { HOOK_OPT_WAR, "Write-After-Read optimization" }, { HOOK_OPT_RAW, "Read-After-Write optimization" }, @@ -45,7 +46,9 @@ static const struct { { HOOK_OPT_CONFIRM, "Confirm-based optimization: replacement" }, { HOOK_OPT_CONFIRM_C, "Confirm-based optimization: replaced by const" }, { HOOK_OPT_CONFIRM_E, "Confirm-based optimization: evaluated" }, + { HOOK_OPT_EXC_REM, "a exception edge was removed due to a Confirmation prove" }, { HOOK_LOWERED, "Lowered" }, + { HOOK_BACKEND, "Backend transformation" }, { FS_OPT_NEUTRAL_0, "algebraic simplification: a op 0 = 0 op a = a" }, { FS_OPT_NEUTRAL_1, "algebraic simplification: a op 1 = 1 op a = a" }, { FS_OPT_ADD_A_A, "algebraic simplification: a + a = a * 2" }, @@ -73,6 +76,7 @@ static const struct { { FS_OPT_MUX_TO_MAX, "algebraic simplification: Mux(a > b, a, b) = Max(a,b)" }, { FS_OPT_MUX_TO_ABS, "algebraic simplification: Mux(a > b, a, b) = Abs(a,b)" }, { FS_OPT_MUX_TO_SHR, "algebraic simplification: Mux(a > b, a, b) = a >> b" }, + { FS_BE_IA32_LEA, "Backend transformation: Lea was created" }, }; static const char *if_conv_names[IF_RESULT_LAST] = { @@ -258,7 +262,7 @@ static void simple_dump_graph(dumper_t *dmp, graph_entry_t *entry) b_entry->cnt_edges.cnt[0], b_entry->cnt_in_edges.cnt[0], b_entry->cnt_out_edges.cnt[0], - b_entry->cnt_phi_data.cnt[0], + b_entry->cnt_phi_data.cnt[0], (double)b_entry->cnt_edges.cnt[0] / (double)b_entry->cnt_nodes.cnt[0] ); } -- 2.20.1