X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=ir%2Fbe%2Fbestat.c;h=832b12dd437f12e078d2787e744fe586bb123d60;hb=6f4069bee42c4f7f88ccb7824f7029b7e3f0b087;hp=de8e44c3e32e008ce49788840ead660de89e1ca6;hpb=21be21bc5d75b5ec68149e5099ed2420c08ea168;p=libfirm diff --git a/ir/be/bestat.c b/ir/be/bestat.c index de8e44c3e..832b12dd4 100644 --- a/ir/be/bestat.c +++ b/ir/be/bestat.c @@ -1,3 +1,8 @@ +/** + * This file calls the corresponding statistic functions for + * some backend statistics. + * $Id$ + */ #ifdef HAVE_CONFIG_H #include "config.h" #endif @@ -9,16 +14,13 @@ #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" #include "besched.h" -#undef MIN -#define MIN(a, b) (a < b ? a : b) - /** * Collect reg pressure statistics per block and per class. */ @@ -45,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); } } @@ -58,12 +60,27 @@ void be_do_stat_reg_pressure(be_irg_t *birg) { * Notify statistic module about amount of ready nodes. */ void be_do_stat_sched_ready(ir_node *block, nodeset *ready_set) { - hook_be_block_sched_ready(block, get_irn_irg(block), MIN(nodeset_count(ready_set), 5)); + stat_be_block_sched_ready(get_irn_irg(block), block, nodeset_count(ready_set)); +} + +/** + * Pass information about a perm to the statistic module. + */ +void be_do_stat_perm(const char *class_name, int n_regs, ir_node *perm, ir_node *block, int n, int real_size) { + stat_be_block_stat_perm(class_name, n_regs, perm, block, n, real_size); +} + +/** + * Pass information about a cycle or chain in a perm to the statistic module. + */ +void be_do_stat_permcycle(const char *class_name, ir_node *perm, ir_node *block, int is_chain, int n_elems, int n_ops) { + stat_be_block_stat_permcycle(class_name, perm, block, is_chain, n_elems, n_ops); } #else void (be_do_stat_reg_pressure)(be_irg_t *birg) {} void (be_do_stat_sched_ready)(ir_node *block, nodeset *ready_set) {} +void (be_do_stat_perm)(const char *class_name, int n_regs, ir_node *perm, ir_node *block, int n, int real_size) {} #endif /* FIRM_STATISTICS */