- stat_hooks[h].hook._##h = fkt; register_hook(h, &stat_hooks[h])
- unsigned num = 0;
-
- if (! (enable_options & FIRMSTAT_ENABLED))
- return;
-
- status = xmalloc(sizeof(*status));
- memset(status, 0, sizeof(*status));
-
- /* enable statistics */
- status->stat_options = enable_options & FIRMSTAT_ENABLED ? enable_options : 0;
-
- /* register all hooks */
- HOOK(hook_new_ir_op, stat_new_ir_op);
- HOOK(hook_free_ir_op, stat_free_ir_op);
- HOOK(hook_new_node, stat_new_node);
- HOOK(hook_turn_into_id, stat_turn_into_id);
- HOOK(hook_new_graph, stat_new_graph);
- HOOK(hook_free_graph, stat_free_graph);
- HOOK(hook_irg_walk, stat_irg_walk);
- HOOK(hook_irg_walk_blkwise, stat_irg_walk_blkwise);
- HOOK(hook_irg_block_walk, stat_irg_block_walk);
- HOOK(hook_merge_nodes, stat_merge_nodes);
- HOOK(hook_reassociate, stat_reassociate);
- HOOK(hook_lower, stat_lower);
- HOOK(hook_inline, stat_inline);
- HOOK(hook_tail_rec, stat_tail_rec);
- HOOK(hook_strength_red, stat_strength_red);
- HOOK(hook_dead_node_elim, stat_dead_node_elim);
- HOOK(hook_if_conversion, stat_if_conversion);
- HOOK(hook_func_call, stat_func_call);
- HOOK(hook_arch_dep_replace_mul_with_shifts, stat_arch_dep_replace_mul_with_shifts);
- HOOK(hook_arch_dep_replace_division_by_const, stat_arch_dep_replace_division_by_const);
-
- obstack_init(&status->cnts);
- obstack_init(&status->be_data);
-
- /* create the hash-tables */
- status->irg_hash = new_pset(graph_cmp, 8);
- status->ir_op_hash = new_pset(opcode_cmp_2, 1);
-
- /* create the wait queue */
- status->wait_q = new_pdeq();
-
- if (enable_options & FIRMSTAT_COUNT_STRONG_OP) {
- /* build the pseudo-ops */
-
- _op_Phi0.code = --num;
- _op_Phi0.name = new_id_from_chars(X("Phi0"));
-
- _op_PhiM.code = --num;
- _op_PhiM.name = new_id_from_chars(X("PhiM"));
-
- _op_ProjM.code = --num;
- _op_ProjM.name = new_id_from_chars(X("ProjM"));
-
- _op_MulC.code = --num;
- _op_MulC.name = new_id_from_chars(X("MulC"));
-
- _op_DivC.code = --num;
- _op_DivC.name = new_id_from_chars(X("DivC"));
-
- _op_ModC.code = --num;
- _op_ModC.name = new_id_from_chars(X("ModC"));
-
- _op_DivModC.code = --num;
- _op_DivModC.name = new_id_from_chars(X("DivModC"));
-
- status->op_Phi0 = &_op_Phi0;
- status->op_PhiM = &_op_PhiM;
- status->op_ProjM = &_op_ProjM;
- status->op_MulC = &_op_MulC;
- status->op_DivC = &_op_DivC;
- status->op_ModC = &_op_ModC;
- status->op_DivModC = &_op_DivModC;
- }
- else {
- status->op_Phi0 = NULL;
- status->op_PhiM = NULL;
- status->op_ProjM = NULL;
- status->op_MulC = NULL;
- status->op_DivC = NULL;
- status->op_ModC = NULL;
- status->op_DivModC = NULL;
- }
-
- if (enable_options & FIRMSTAT_COUNT_SELS) {
- _op_SelSel.code = --num;
- _op_SelSel.name = new_id_from_chars(X("Sel(Sel)"));
-
- _op_SelSelSel.code = --num;
- _op_SelSelSel.name = new_id_from_chars(X("Sel(Sel(Sel))"));
-
- status->op_SelSel = &_op_SelSel;
- status->op_SelSelSel = &_op_SelSelSel;
- }
- else {
- status->op_SelSel = NULL;
- status->op_SelSelSel = NULL;
- }
-
- /* register the dumper */
- stat_register_dumper(&simple_dumper);
-
- if (enable_options & FIRMSTAT_CSV_OUTPUT)
- stat_register_dumper(&csv_dumper);
-
- /* initialize the pattern hash */
- stat_init_pattern_history(enable_options & FIRMSTAT_PATTERN_ENABLED);
-
- /* initialize the Const options */
- if (enable_options & FIRMSTAT_COUNT_CONSTS)
- stat_init_const_cnt(status);
+ stat_hooks[h].hook._##h = fkt; register_hook(h, &stat_hooks[h])
+ unsigned num = 0;
+
+ if (! (enable_options & FIRMSTAT_ENABLED))
+ return;
+
+ status = xmalloc(sizeof(*status));
+ memset(status, 0, sizeof(*status));
+
+ /* enable statistics */
+ status->stat_options = enable_options & FIRMSTAT_ENABLED ? enable_options : 0;
+
+ /* register all hooks */
+ HOOK(hook_new_ir_op, stat_new_ir_op);
+ HOOK(hook_free_ir_op, stat_free_ir_op);
+ HOOK(hook_new_node, stat_new_node);
+ HOOK(hook_turn_into_id, stat_turn_into_id);
+ HOOK(hook_new_graph, stat_new_graph);
+ HOOK(hook_free_graph, stat_free_graph);
+ HOOK(hook_irg_walk, stat_irg_walk);
+ HOOK(hook_irg_walk_blkwise, stat_irg_walk_blkwise);
+ HOOK(hook_irg_block_walk, stat_irg_block_walk);
+ HOOK(hook_merge_nodes, stat_merge_nodes);
+ HOOK(hook_reassociate, stat_reassociate);
+ HOOK(hook_lower, stat_lower);
+ HOOK(hook_inline, stat_inline);
+ HOOK(hook_tail_rec, stat_tail_rec);
+ HOOK(hook_strength_red, stat_strength_red);
+ HOOK(hook_dead_node_elim, stat_dead_node_elim);
+ HOOK(hook_if_conversion, stat_if_conversion);
+ HOOK(hook_func_call, stat_func_call);
+ HOOK(hook_arch_dep_replace_mul_with_shifts, stat_arch_dep_replace_mul_with_shifts);
+ HOOK(hook_arch_dep_replace_division_by_const, stat_arch_dep_replace_division_by_const);
+
+ obstack_init(&status->cnts);
+ obstack_init(&status->be_data);
+
+ /* create the hash-tables */
+ status->irg_hash = new_pset(graph_cmp, 8);
+ status->ir_op_hash = new_pset(opcode_cmp_2, 1);
+
+ /* create the wait queue */
+ status->wait_q = new_pdeq();
+
+ if (enable_options & FIRMSTAT_COUNT_STRONG_OP) {
+ /* build the pseudo-ops */
+
+ _op_Phi0.code = --num;
+ _op_Phi0.name = new_id_from_chars(X("Phi0"));
+
+ _op_PhiM.code = --num;
+ _op_PhiM.name = new_id_from_chars(X("PhiM"));
+
+ _op_ProjM.code = --num;
+ _op_ProjM.name = new_id_from_chars(X("ProjM"));
+
+ _op_MulC.code = --num;
+ _op_MulC.name = new_id_from_chars(X("MulC"));
+
+ _op_DivC.code = --num;
+ _op_DivC.name = new_id_from_chars(X("DivC"));
+
+ _op_ModC.code = --num;
+ _op_ModC.name = new_id_from_chars(X("ModC"));
+
+ _op_DivModC.code = --num;
+ _op_DivModC.name = new_id_from_chars(X("DivModC"));
+
+ status->op_Phi0 = &_op_Phi0;
+ status->op_PhiM = &_op_PhiM;
+ status->op_ProjM = &_op_ProjM;
+ status->op_MulC = &_op_MulC;
+ status->op_DivC = &_op_DivC;
+ status->op_ModC = &_op_ModC;
+ status->op_DivModC = &_op_DivModC;
+ } else {
+ status->op_Phi0 = NULL;
+ status->op_PhiM = NULL;
+ status->op_ProjM = NULL;
+ status->op_MulC = NULL;
+ status->op_DivC = NULL;
+ status->op_ModC = NULL;
+ status->op_DivModC = NULL;
+ } /* if */
+
+ /* for Florian: count the Sel depth */
+ if (enable_options & FIRMSTAT_COUNT_SELS) {
+ _op_SelSel.code = --num;
+ _op_SelSel.name = new_id_from_chars(X("Sel(Sel)"));
+
+ _op_SelSelSel.code = --num;
+ _op_SelSelSel.name = new_id_from_chars(X("Sel(Sel(Sel))"));
+
+ status->op_SelSel = &_op_SelSel;
+ status->op_SelSelSel = &_op_SelSelSel;
+ } else {
+ status->op_SelSel = NULL;
+ status->op_SelSelSel = NULL;
+ } /* if */
+
+ /* register the dumper */
+ stat_register_dumper(&simple_dumper);
+
+ if (enable_options & FIRMSTAT_CSV_OUTPUT)
+ stat_register_dumper(&csv_dumper);
+
+ /* initialize the pattern hash */
+ stat_init_pattern_history(enable_options & FIRMSTAT_PATTERN_ENABLED);
+
+ /* initialize the Const options */
+ if (enable_options & FIRMSTAT_COUNT_CONSTS)
+ stat_init_const_cnt(status);