Added is_Const
[libfirm] / ir / stat / firmstat.c
index 2f38aa6..0411455 100644 (file)
@@ -298,6 +298,7 @@ static void block_clear_entry(block_entry_t *elem)
   cnt_clr(&elem->cnt_edges);
   cnt_clr(&elem->cnt_in_edges);
   cnt_clr(&elem->cnt_out_edges);
+  cnt_clr(&elem->cnt_phi_data);
 }
 
 /**
@@ -398,6 +399,13 @@ static void undate_block_info(ir_node *node, graph_entry_t *graph)
     }
     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);
@@ -1208,7 +1216,7 @@ static void stat_inline(void *ctx, ir_node *call, ir_graph *called_irg)
  *
  * @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;
@@ -1217,7 +1225,7 @@ static void stat_tail_rec(void *ctx, ir_graph *irg)
   {
     graph_entry_t *graph = graph_get_entry(irg, status->irg_hash);
 
-    graph->num_tail_recursion++;
+    graph->num_tail_recursion += n_calls;
   }
   STAT_LEAVE;
 }