af60a82b99c98799806ad3addc9cfdfb9e8757de
[libfirm] / ir / be / bera.h
1 /**
2  * Register allocation functions.
3  * @author Sebastian Hack
4  * @date 13.1.2005
5  */
6
7 #ifndef _BERA_H
8 #define _BERA_H
9
10 #include "firm_config.h"
11
12 #ifdef WITH_LIBCORE
13 #include <libcore/lc_opts.h>
14 #include <libcore/lc_timing.h>
15 #endif
16
17 #include "firm_types.h"
18
19 #include "be.h"
20 #include "belive.h"
21
22 typedef struct {
23         lc_timer_t *t_prolog;      /**< timer for prolog */
24         lc_timer_t *t_epilog;      /**< timer for epilog */
25         lc_timer_t *t_live;        /**< timer for liveness calculation */
26         lc_timer_t *t_spill;       /**< timer for spilling */
27         lc_timer_t *t_color;       /**< timer for graph coloring */
28         lc_timer_t *t_ifg;         /**< timer for building interference graph */
29         lc_timer_t *t_copymin;     /**< timer for copy minimization */
30         lc_timer_t *t_ssa;         /**< timer for ssa destruction */
31         lc_timer_t *t_verify;      /**< timer for verification runs */
32         lc_timer_t *t_other;       /**< timer for remaining stuff */
33 } be_ra_timer_t;
34
35 typedef struct {
36 #ifdef WITH_LIBCORE
37         void (*register_options)(lc_opt_entry_t *grp);
38 #endif
39         be_ra_timer_t *(*allocate)(const be_irg_t *bi);
40 } be_ra_t;
41
42
43
44 /**
45  * Check, if two values interfere.
46  * @param lv Liveness information.
47  * @param a The first value.
48  * @param b The second value.
49  * @return 1, if @p a and @p b interfere, 0 if not.
50  */
51 int values_interfere(const be_lv_t *lv, const ir_node *a, const ir_node *b);
52
53 /**
54  * Check, if a value dominates the other one.
55  * Note, that this function also considers the schedule and does thus
56  * more than block_dominates().
57  *
58  * @param a The first.
59  * @param b The second value.
60  * @return 1 if a dominates b, 0 else.
61  */
62 int value_dominates(const ir_node *a, const ir_node *b);
63
64 #endif /* _BERA_H */