cd4fe0469d3b092c2563732a9c445a27d6365857
[libfirm] / ir / be / bestat.h
1 #ifndef _BESTAT_H_
2 #define _BESTAT_H_
3
4 #include "firm_config.h"
5 #include "be_t.h"
6 #include "benodesets.h"
7
8 #ifdef FIRM_STATISTICS
9
10 /**
11  * Collects statistics information about register pressure.
12  * @param birg The be irg object containing the irg
13  */
14 void be_do_stat_reg_pressure(be_irg_t *birg);
15
16 /**
17  * Collect statistics about amount of ready nodes per block
18  * @param block     The block
19  * @param ready_set A set of ready nodes
20  */
21 void be_do_stat_sched_ready(ir_node *block, nodeset *ready_set);
22
23 /**
24  * Pass information about a perm to the statistic module.
25  *
26  * @param class_name the name of the register class
27  * @param n_regs     number of registers in the register class
28  * @param perm       the perm node
29  * @param block      the block containing the perm
30  * @param size       the size of the perm
31  * @param real_size  number of pairs with different registers
32  */
33 void be_do_stat_perm(const char *class_name, int n_regs, ir_node *perm, ir_node *block, int n, int real_size);
34
35 /**
36  * Pass information about a cycle or chain in a perm to the statistic module.
37  *
38  * @param class_name the name of the register class
39  * @param perm       the perm node
40  * @param block      the block containing the perm
41  * @param is_chain   1 if chain, 0 if cycle
42  * @param size       length of the cycle/chain
43  * @param n_ops      the number of ops representing this cycle/chain after lowering
44  */
45 void be_do_stat_permcycle(const char *class_name, ir_node *perm, ir_node *block, int is_chain, int n_elems, int n_ops);
46
47 #else
48
49 #define be_do_stat_reg_pressure(birg)
50 #define be_do_stat_sched_ready(block, ready_set)
51 #define be_do_stat_perm(class_name, n_regs, perm, block, n, real_size)
52 #define be_do_stat_permcycle(class_name, perm, block, is_chain, n_elems, n_ops)
53
54 #endif /* FIRM_STATISTICS */
55
56 #endif /* _BESTAT_H_ */