Small changes
[libfirm] / ir / be / bestat.c
index 1a238f1..c7d181b 100644 (file)
@@ -1,10 +1,21 @@
+/**
+ * This file calls the corresponding statistic functions for
+ * some backend statistics.
+ * $Id$
+ */
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#ifdef FIRM_STATISTICS
+
 #include "irnode_t.h"
 #include "irprintf.h"
 #include "irgwalk.h"
 #include "irhooks.h"
 #include "dbginfo_t.h"
-#include "firmstat.h"
-#include "ident.h"
+#include "firmstat_t.h"
+#include "irtools.h"
 
 #include "bestat.h"
 #include "belive_t.h"
@@ -36,7 +47,7 @@ static void stat_reg_pressure_block(ir_node *block, void *env) {
                        max_live = cnt < max_live ? max_live : cnt;
                }
 
-               hook_be_block_regpressure(block, birg->irg, max_live, new_id_from_str(cls->name));
+               stat_be_block_regpressure(birg->irg, block, MIN(max_live, 5), cls->name);
        }
 }
 
@@ -44,3 +55,17 @@ void be_do_stat_reg_pressure(be_irg_t *birg) {
        /* Collect register pressure information for each block */
        irg_block_walk_graph(birg->irg, stat_reg_pressure_block, NULL, birg);
 }
+
+/**
+ * Notify statistic module about amount of ready nodes.
+ */
+void be_do_stat_sched_ready(ir_node *block, nodeset *ready_set) {
+       stat_be_block_sched_ready(get_irn_irg(block), block, nodeset_count(ready_set));
+}
+
+#else
+
+void (be_do_stat_reg_pressure)(be_irg_t *birg) {}
+void (be_do_stat_sched_ready)(ir_node *block, nodeset *ready_set) {}
+
+#endif /* FIRM_STATISTICS */