/** The memory Proj node. */
static ir_op _op_ProjM;
+/** A Sel of a Sel */
+static ir_op _op_SelSel;
+
+/** A Sel of a Sel of a Sel */
+static ir_op _op_SelSelSel;
+
/* ---------------------------------------------------------------------------------- */
/** Marks the begin of a statistic (hook) function. */
cnt_clr(&elem->cnt_edges);
cnt_clr(&elem->cnt_in_edges);
cnt_clr(&elem->cnt_out_edges);
+ cnt_clr(&elem->cnt_phi_data);
}
/**
/* special case, a division/modulo by a const, count on extra counter */
op = status->op_DivModC ? status->op_DivModC : op;
}
+ else if (op == op_Sel && get_irn_op(get_Sel_ptr(node)) == op_Sel) {
+ /* special case, a Sel of a Sel, count on extra counter */
+ op = status->op_SelSel ? status->op_SelSel : op;
+
+ if (get_irn_op(get_Sel_ptr(get_Sel_ptr(node))) == op_Sel) {
+ /* special case, a Sel of a Sel of a Sel, count on extra counter */
+ op = status->op_SelSelSel ? status->op_SelSelSel : op;
+ }
+ }
return op;
}
}
return;
}
+ else if (op == op_Phi && mode_is_datab(get_irn_mode(node))) {
+ /* count data Phi */
+ ir_node *block = get_nodes_block(node);
+ block_entry_t *b_entry = block_get_entry(get_irn_node_nr(block), graph->block_hash);
+
+ cnt_inc(&b_entry->cnt_phi_data);
+ }
block = get_nodes_block(node);
b_entry = block_get_entry(get_irn_node_nr(block), graph->block_hash);
*
* @param ctx the hook context
*/
-static void stat_tail_rec(void *ctx, ir_graph *irg)
+static void stat_tail_rec(void *ctx, ir_graph *irg, int n_calls)
{
if (! status->stat_options)
return;
{
graph_entry_t *graph = graph_get_entry(irg, status->irg_hash);
- graph->num_tail_recursion++;
+ graph->num_tail_recursion += n_calls;
}
STAT_LEAVE;
}
status->op_DivModC = NULL;
}
+ if (enable_options & FIRMSTAT_COUNT_SELS) {
+ _op_SelSel.code = get_next_ir_opcode();
+ _op_SelSel.name = new_id_from_chars(X("Sel(Sel)"));
+
+ _op_SelSelSel.code = get_next_ir_opcode();
+ _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);