+#include "beirg.h"
+#include "bestatevent.h"
+#include "bearch.h"
+
+enum be_stat_tag_t {
+ BE_STAT_PHIS, /**< phi count (excluding mem-phis) */
+ BE_STAT_MEM_PHIS, /**< memory-phi count */
+ BE_STAT_COPIES, /**< copies */
+ BE_STAT_PERMS, /**< perms */
+ BE_STAT_SPILLS, /**< spills (also folded spills) */
+ BE_STAT_RELOADS, /**< reloads (also folded reloads) */
+ BE_STAT_REMATS, /**< rematerialized nodes */
+ BE_STAT_COUNT
+};
+typedef unsigned long be_node_stats_t[BE_STAT_COUNT];
+
+/**
+ * Collect statistics about node types
+ */
+void be_collect_node_stats(be_node_stats_t *stats, be_irg_t *birg);
+
+void be_subtract_node_stats(be_node_stats_t *stats, be_node_stats_t *sub);
+
+void be_copy_node_stats(be_node_stats_t *dest, be_node_stats_t *src);
+
+void be_emit_node_stats(be_node_stats_t *stats, const char *prefix);