2 * Register allocation functions.
3 * @author Sebastian Hack
9 #include "firm_config.h"
11 #include <libcore/lc_timing.h>
13 #include "firm_types.h"
21 lc_timer_t *t_prolog; /**< timer for prolog */
22 lc_timer_t *t_epilog; /**< timer for epilog */
23 lc_timer_t *t_live; /**< timer for liveness calculation */
24 lc_timer_t *t_spill; /**< timer for spilling */
25 lc_timer_t *t_spillslots; /**< spillslot coalescing */
26 lc_timer_t *t_color; /**< timer for graph coloring */
27 lc_timer_t *t_ifg; /**< timer for building interference graph */
28 lc_timer_t *t_copymin; /**< timer for copy minimization */
29 lc_timer_t *t_ssa; /**< timer for ssa destruction */
30 lc_timer_t *t_verify; /**< timer for verification runs */
31 lc_timer_t *t_other; /**< timer for remaining stuff */
34 extern be_ra_timer_t *global_ra_timer;
36 typedef struct be_ra_t {
37 void (*allocate)(be_irg_t *bi); /**< allocate registers on a graph */
40 void be_register_allocator(const char *name, be_ra_t *allocator);
43 * Do register allocation with currently selected register allocator
45 void be_allocate_registers(be_irg_t *birg);
48 * Check, if two values interfere.
49 * @param lv Liveness information.
50 * @param a The first value.
51 * @param b The second value.
52 * @return 1, if @p a and @p b interfere, 0 if not.
54 int values_interfere(const be_lv_t *lv, const ir_node *a, const ir_node *b);
57 * Check, if a value dominates the other one.
58 * Note, that this function also considers the schedule and does thus
59 * more than block_dominates().
62 * @param b The second value.
63 * @return 1 if a dominates b, 0 else.
65 int value_dominates(const ir_node *a, const ir_node *b);
68 * Like value_dominates(), but the nodes have to be in the same block
70 int value_dominates_intrablock(const ir_node *a, const ir_node *b);