added scheduling preparation switch
[libfirm] / ir / be / be_t.h
1 /**
2  * Internal backend global data structures.
3  * @author Sebastian Hack
4  * @date 8.12.2004
5  */
6
7 #ifndef _BE_T_H
8 #define _BE_T_H
9
10 #include "firm_types.h"
11 #include "obst.h"
12 #include "debug.h"
13 #include "bitset.h"
14
15 #include "be.h"
16 #include "bearch.h"
17 #include "beirgmod.h"
18 #include "be_dbgout.h"
19
20 #define DUMP_NONE       0
21 #define DUMP_INITIAL    (1 << 0)
22 #define DUMP_ABI        (1 << 1)
23 #define DUMP_SCHED      (1 << 2)
24 #define DUMP_PREPARED   (1 << 3)
25 #define DUMP_RA         (1 << 4)
26 #define DUMP_FINAL      (1 << 5)
27 #define DUMP_BE         (1 << 6)
28
29 enum {
30         BE_TIME_OFF,
31         BE_TIME_ON
32 };
33
34 enum {
35         BE_VRFY_OFF,
36         BE_VRFY_WARN,
37         BE_VRFY_ASSERT
38 };
39
40 enum {
41         BE_SCHED_SELECT_TRIVIAL  = 0,
42         BE_SCHED_SELECT_REGPRESS = 1,
43         BE_SCHED_SELECT_MUCHNIK  = 2,
44         BE_SCHED_SELECT_HEUR     = 3,
45         BE_SCHED_SELECT_HMUCHNIK = 4,
46         BE_SCHED_SELECT_RANDOM   = 5
47 };
48
49 enum {
50         BE_SCHED_PREP_NONE = 0,
51         BE_SCHED_PREP_MRIS = 2,
52         BE_SCHED_PREP_RSS  = 3
53 };
54
55 /** Backend options */
56 struct _be_options_t {
57         int  dump_flags;          /**< backend dumping flags */
58         int  timing;              /**< time the backend phases */
59         int  sched_select;        /**< the current scheduler */
60         int  sched_prep;
61         int  opt_profile;         /**< instrument code for profiling */
62         int  mris;                /**< enable mris preparation */
63         int  omit_fp;             /**< try to omit the frame pointer */
64         int  stabs_debug_support; /**< enable stabs debugging support */
65         int  vrfy_option;         /**< backend verify option */
66         char ilp_server[128];     /**< the ilp server name */
67         char ilp_solver[128];     /**< the ilp solver name */
68 };
69
70 struct _be_main_env_t {
71         struct obstack obst;
72         struct _be_node_factory_t *node_factory;
73         struct _arch_env_t *arch_env;
74         struct _be_options_t *options;
75         struct _arch_code_generator_t *cg;
76         struct _arch_irn_handler_t *phi_handler;
77         dbg_handle *db_handle;
78         DEBUG_ONLY(firm_dbg_module_t *dbg;)
79 };
80
81 struct _be_irg_t {
82         ir_graph                      *irg;
83         struct _be_main_env_t         *main_env;
84         struct _be_abi_irg_t          *abi;
85         struct _arch_code_generator_t *cg;
86         exec_freq_t *execfreqs;
87 };
88
89 /**
90 * Put the registers to be ignored in this IRG into a bitset.
91 * @param birg The backend IRG data structure.
92 * @param cls  The register class.
93 * @param bs   The bitset (may be NULL).
94 * @return The number of registers to be ignored.
95 */
96 int be_put_ignore_regs(const struct _be_irg_t *birg, const struct _arch_register_class_t *cls, bitset_t *bs);
97
98
99
100 #endif /* _BE_T_H */