config.h include added
[libfirm] / ir / be / becopystat.h
1 /**
2  * @author Daniel Grund
3  * @date 11.04.2005
4  */
5 #undef 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 /**
19  * For an explanation of these values see phi_stat_dump_pretty
20  */
21 enum vals_t {
22         I_ALL_NODES = 0,
23         I_BLOCKS,
24
25         /* phi nodes */
26         I_PHI_CNT,                      /* number of phi nodes */
27         I_PHI_ARG_CNT,          /* number of arguments of phis */
28         I_PHI_ARG_SELF,         /* number of arguments of phis being the phi itself */
29         I_PHI_ARG_CONST,        /* number of arguments of phis being consts */
30         I_PHI_ARG_PRED,         /* ... being defined in a cf-pred */
31         I_PHI_ARG_GLOB,         /* ... being defined elsewhere */
32         I_PHI_ARITY_S,
33         I_PHI_ARITY_E    = I_PHI_ARITY_S+MAX_ARITY,
34
35         /* phi classes */
36         I_CLS_CNT,                      /* number of phi classes */
37         I_CLS_IF_FREE,          /* number of pc having no interference */
38         I_CLS_IF_MAX,           /* number of possible interferences in all classes */
39         I_CLS_IF_CNT,           /* number of actual interferences in all classes */
40         I_CLS_SIZE_S,
41         I_CLS_SIZE_E = I_CLS_SIZE_S+MAX_CLS_SIZE,
42
43         /* TODO copy nodes */
44         I_CPY_CNT,                      /* number of copynodes */
45
46         /* TODO ilp values */
47         I_ILP_TIME,                     /* !external set! solving time in 10th seconds */
48         I_ILP_ITER,                     /* !external set! number of simplex iterations */
49
50         /* copy instructions */
51         I_COPIES_MAX,           /* max number of copies possible */
52         I_COPIES_INIT,          /* !external set! number of copies in initial allocation */
53         I_COPIES_HEUR,          /* !external set! number of copies after heuristic */
54         I_COPIES_OPT,           /* !external set! number of copies after ilp */
55         I_COPIES_LB,            /* !external set! the lower bound used for number of copies */
56         I_COPIES_IF,            /* number of copies inevitable due to root-arg-interf */
57
58         ASIZE
59 };
60
61 /**
62  * Holds current values. Values are added till next phi_stat_reset
63  */
64 int curr_vals[ASIZE];
65
66 void stat_init(void);
67
68 /**
69  * Resets the array holding the data
70  */
71 void stat_reset(void);
72
73 /**
74  * Collect common irg data
75  */
76 void stat_collect_irg(ir_graph *irg);
77
78 /**
79  * Dumps the current contents of the internal values to a file.
80  */
81 void stat_dump(ir_graph *irg);
82
83 /**
84  * Dumps the current contents of the values array and annotations to a file.
85  */
86 void stat_dump_pretty(ir_graph *irg);
87
88 #endif
89 #endif