Bugfix concerning lower bound compution. Debug-Level for specific IRG
[libfirm] / ir / be / becopystat.h
1 /**
2  * @author Daniel Grund
3  * @date 11.04.2005
4  */
5 #define DO_STAT
6
7 #ifdef DO_STAT
8
9 #ifndef _BECOPYSTAT_H
10 #define _BECOPYSTAT_H
11
12 #include "irgraph.h"
13
14 #define MAX_ARITY 10
15 #define MAX_CLS_SIZE 10
16 #define MAX_PHASE 2
17 /**
18  * For an explanation of these values see phi_stat_dump_pretty
19  */
20 enum vals_t {
21         I_ALL_NODES = 0,
22         I_BLOCKS,
23
24         I_PHI_CNT,                      /* number of phi nodes */
25         I_PHI_ARG_CNT,          /* number of arguments of phis */
26         I_PHI_ARG_SELF,         /* number of arguments of phis being the phi itself */
27         I_PHI_ARG_CONST,        /* number of arguments of phis being consts */
28         I_PHI_ARG_PRED,         /* ... being defined in a cf-pred */
29         I_PHI_ARG_GLOB,         /* ... being defined elsewhere */
30         I_PHI_ARITY_S,
31         I_PHI_ARITY_E    = I_PHI_ARITY_S+MAX_ARITY,
32
33         I_CLS_CNT,                      /* number of phi classes */
34         I_CLS_IF_FREE,          /* number of pc having no interference */
35         I_CLS_IF_MAX,           /* number of possible interferences in all classes */
36         I_CLS_IF_CNT,           /* number of actual interferences in all classes */
37         I_CLS_SIZE_S,
38         I_CLS_SIZE_E = I_CLS_SIZE_S+MAX_CLS_SIZE,
39
40         I_COPIES_MAX,           /* max number of copies possible */
41         I_COPIES_INIT,          /* !external set! number of copies in initial allocation */
42         I_COPIES_HEUR,          /* !external set! number of copies after heuristic */
43         I_COPIES_OPT,           /* !external set! number of copies after ilp */
44         I_COPIES_LB,            /* !external set! the lower bound used for number of copies */
45         I_COPIES_IF,            /* number of copies inevitable due to root-arg-interf */
46
47         ASIZE
48 };
49
50 /**
51  * Holds current values. Values are added till next phi_stat_reset
52  */
53 int curr_vals[ASIZE];
54
55 void stat_init(void);
56
57 /**
58  * Resets the array holding the data
59  */
60 void stat_reset(void);
61
62 /**
63  * Collect common irg data
64  */
65 void stat_collect_irg(ir_graph *irg);
66
67 /**
68  * Dumps the current contents of the internal values to a file.
69  */
70 void stat_dump(ir_graph *irg);
71
72 /**
73  * Dumps the current contents of the values array and annotations to a file.
74  */
75 void stat_dump_pretty(ir_graph *irg);
76
77 #endif
78 #endif