+/**
+ * update the extended block counter
+ */
+static void undate_extbb_info(ir_node *node, graph_entry_t *graph)
+{
+ ir_op *op = get_irn_op(node);
+ ir_extblk *extbb;
+ extbb_entry_t *eb_entry;
+ int i, arity;
+
+ /* check for block */
+ if (op == op_Block) {
+ extbb = get_nodes_extbb(node);
+ arity = get_irn_arity(node);
+ eb_entry = block_get_entry(&graph->recalc_cnts, get_extbb_node_nr(extbb), graph->extbb_hash);
+
+ /* count all incoming edges */
+ for (i = 0; i < arity; ++i) {
+ ir_node *pred = get_irn_n(node, i);
+ ir_extblk *other_extbb = get_nodes_extbb(pred);
+
+ if (extbb != other_extbb) {
+ extbb_entry_t *eb_entry_other = block_get_entry(&graph->recalc_cnts, get_extbb_node_nr(other_extbb), graph->extbb_hash);
+
+ cnt_inc(&eb_entry->cnt_in_edges); /* an edge coming from another extbb */
+ cnt_inc(&eb_entry_other->cnt_out_edges);
+ }
+ }
+ return;
+ }
+
+ extbb = get_nodes_extbb(node);
+ eb_entry = block_get_entry(&graph->recalc_cnts, get_extbb_node_nr(extbb), graph->extbb_hash);
+
+ if (op == op_Phi && mode_is_datab(get_irn_mode(node))) {
+ /* count data Phi per extbb */
+ cnt_inc(&eb_entry->cnt_phi_data);
+ }
+
+ /* we have a new node in our block */
+ cnt_inc(&eb_entry->cnt_nodes);
+
+ /* don't count keep-alive edges */
+ if (get_irn_op(node) == op_End)
+ return;
+
+ arity = get_irn_arity(node);
+
+ for (i = 0; i < arity; ++i) {
+ ir_node *pred = get_irn_n(node, i);
+ ir_extblk *other_extbb = get_nodes_extbb(pred);
+
+ if (other_extbb == extbb)
+ cnt_inc(&eb_entry->cnt_edges); /* a in extbb edge */
+ else {
+ extbb_entry_t *eb_entry_other = block_get_entry(&graph->recalc_cnts, get_extbb_node_nr(other_extbb), graph->extbb_hash);
+
+ cnt_inc(&eb_entry->cnt_in_edges); /* an edge coming from another extbb */
+ cnt_inc(&eb_entry_other->cnt_out_edges);
+ }
+ }
+}
+
+/** calculates how many arguments of the call are const */
+static int cnt_const_args(ir_node *call)
+{
+ int i, res = 0;
+ int n = get_Call_n_params(call);
+
+ for (i = 0; i < n; ++i) {
+ ir_node *param = get_Call_param(call, i);
+ ir_op *op = get_irn_op(param);
+
+ if (op == op_Const || op == op_SymConst)
+ ++res;
+ }
+ return res;
+}
+