fix wrong lea to add transformation
[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 #include <libcore/lc_timing.h>
13
14 #include "firm_types.h"
15
16 #include "be.h"
17 #include "belive.h"
18 #include "beirg.h"
19 #include "bemodule.h"
20
21 typedef struct {
22         lc_timer_t *t_prolog;      /**< timer for prolog */
23         lc_timer_t *t_epilog;      /**< timer for epilog */
24         lc_timer_t *t_live;        /**< timer for liveness calculation */
25         lc_timer_t *t_spill;       /**< timer for spilling */
26         lc_timer_t *t_spillslots;  /**< spillslot coalescing */
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 extern be_ra_timer_t *global_ra_timer;
36
37 typedef struct be_ra_t {
38         void (*allocate)(be_irg_t *bi);   /**< allocate registers on a graph */
39 } be_ra_t;
40
41 void be_register_allocator(const char *name, be_ra_t *allocator);
42
43 /**
44  * Do register allocation with currently selected register allocator
45  */
46 void be_allocate_registers(be_irg_t *birg);
47
48 /**
49  * Check, if two values interfere.
50  * @param lv Liveness information.
51  * @param a The first value.
52  * @param b The second value.
53  * @return 1, if @p a and @p b interfere, 0 if not.
54  */
55 int values_interfere(const be_lv_t *lv, const ir_node *a, const ir_node *b);
56
57 /**
58  * Check, if a value dominates the other one.
59  * Note, that this function also considers the schedule and does thus
60  * more than block_dominates().
61  *
62  * @param a The first.
63  * @param b The second value.
64  * @return 1 if a dominates b, 0 else.
65  */
66 int value_dominates(const ir_node *a, const ir_node *b);
67
68 #endif /* _BERA_H */