Killed an ugly bug. Set default not to use ILP. Improvements in copystat module.
[libfirm] / ir / be / becopystat.h
1 /**
2  * Author:      Daniel Grund
3  * Date:                11.04.2005
4  * Copyright:   (c) Universitaet Karlsruhe
5  * Licence:     This file protected by GPL -  GNU GENERAL PUBLIC LICENSE.
6  */
7 #ifndef _BECOPYSTAT_H
8 #define _BECOPYSTAT_H
9
10 #define DO_STAT
11 #ifdef DO_STAT
12
13 #include "irgraph.h"
14
15 #define MAX_ARITY 10
16 #define MAX_CLS_SIZE 10
17 #define MAX_PHASE 2
18
19 /**
20  * For an explanation of these values see phi_copystat_dump_pretty
21  */
22 enum vals_t {
23         I_ALL_NODES = 0,
24         I_BLOCKS,
25
26         /* phi nodes */
27         I_PHI_CNT,                      /* number of phi nodes */
28         I_PHI_ARG_CNT,          /* number of arguments of phis */
29         I_PHI_ARG_SELF,         /* number of arguments of phis being the phi itself */
30         I_PHI_ARG_CONST,        /* number of arguments of phis being consts */
31         I_PHI_ARG_PRED,         /* ... being defined in a cf-pred */
32         I_PHI_ARG_GLOB,         /* ... being defined elsewhere */
33         I_PHI_ARITY_S,
34         I_PHI_ARITY_E    = I_PHI_ARITY_S+MAX_ARITY,
35
36         /* copy nodes */
37         I_CPY_CNT,                      /* number of copynodes */
38
39         /* phi classes */
40         I_CLS_CNT,                      /* number of phi classes */
41         I_CLS_IF_FREE,          /* number of pc having no interference */
42         I_CLS_IF_MAX,           /* number of possible interferences in all classes */
43         I_CLS_IF_CNT,           /* number of actual interferences in all classes */
44         I_CLS_SIZE_S,
45         I_CLS_SIZE_E = I_CLS_SIZE_S+MAX_CLS_SIZE,
46
47         /* ilp values */
48         I_ILP_TIME,                     /* !external set! solving time in seconds */
49         I_ILP_ITER,                     /* !external set! number of simplex iterations */
50
51         /* copy instructions */
52         I_COPIES_MAX,           /* max number of copies possible */
53         I_COPIES_IF,            /* number of copies inevitable due to root-arg-interf */
54         I_COPIES_INIT,          /* !external set! number of copies in initial allocation */
55         I_COPIES_HEUR,          /* !external set! number of copies after heuristic */
56         I_COPIES_OPT,           /* !external set! number of copies after ilp */
57
58         ASIZE
59 };
60
61 /**
62  * Holds current values. Values are added till next copystat_reset
63  */
64 int curr_vals[ASIZE];
65
66 void copystat_init(void);
67 void copystat_reset(void);
68 void copystat_collect_irg(ir_graph *irg);
69 void copystat_collect_cls(be_chordal_env_t *chordal_env);
70 void copystat_dump(ir_graph *irg);
71 void copystat_dump_pretty(ir_graph *irg);
72
73 #else /* DO_STAT */
74
75 #define copy_copystat_init();
76 #define copystat_reset();
77 #define copystat_collect_irg(irg);
78 #define copystat_collect_cls(env);
79 #define copystat_dump(irg);
80 #define copystat_dump(irg);
81 #define copystat_dump_pretty(irg);
82
83 #endif /* DO_STAT */
84
85 #endif /* _BECOPYSTAT_H */