- new spillslots dump phase
[libfirm] / ir / be / bestat.h
1 /**
2  * Provides several statistic functions for the backend.
3  * @author Christian Wuerdig
4  * $Id$
5  */
6
7 #ifndef _BESTAT_H_
8 #define _BESTAT_H_
9
10 #include "firm_config.h"
11 #include "be_t.h"
12 #include "benodesets.h"
13
14 #ifdef FIRM_STATISTICS
15
16 /**
17  * Collects statistics information about register pressure.
18  * @param birg The be irg object containing the irg
19  */
20 void be_do_stat_reg_pressure(be_irg_t *birg);
21
22 /**
23  * Collect statistics about amount of ready nodes per block
24  * @param block     The block
25  * @param ready_set A set of ready nodes
26  */
27 void be_do_stat_sched_ready(ir_node *block, nodeset *ready_set);
28
29 /**
30  * Pass information about a perm to the statistic module.
31  *
32  * @param class_name the name of the register class
33  * @param n_regs     number of registers in the register class
34  * @param perm       the perm node
35  * @param block      the block containing the perm
36  * @param size       the size of the perm
37  * @param real_size  number of pairs with different registers
38  */
39 void be_do_stat_perm(const char *class_name, int n_regs, ir_node *perm, ir_node *block, int n, int real_size);
40
41 /**
42  * Pass information about a cycle or chain in a perm to the statistic module.
43  *
44  * @param class_name the name of the register class
45  * @param perm       the perm node
46  * @param block      the block containing the perm
47  * @param is_chain   1 if chain, 0 if cycle
48  * @param size       length of the cycle/chain
49  * @param n_ops      the number of ops representing this cycle/chain after lowering
50  */
51 void be_do_stat_permcycle(const char *class_name, ir_node *perm, ir_node *block, int is_chain, int n_elems, int n_ops);
52
53 /**
54  * Collects node statistics.
55  *
56  * @param irg      the to do statistics for
57  * @param phase    the phase to collect the statistic for
58  */
59 void be_do_stat_nodes(ir_graph *irg, const char *phase);
60
61 /**
62  * Performs initialization for be node statistics.
63  */
64 void be_stat_init_irg(const arch_env_t *arch_env, ir_graph *irg);
65
66 #else
67
68 #define be_stat_init_irg(arch_env, irg)
69 #define be_do_stat_nodes(irg, phase)
70 #define be_do_stat_reg_pressure(birg)
71 #define be_do_stat_sched_ready(block, ready_set)
72 #define be_do_stat_perm(class_name, n_regs, perm, block, n, real_size)
73 #define be_do_stat_permcycle(class_name, perm, block, is_chain, n_elems, n_ops)
74
75 #endif /* FIRM_STATISTICS */
76
77 #endif /* _BESTAT_H_ */