int colors_n; /**< The number of colors. */
} be_chordal_alloc_env_t;
-#if 0
-static void check_border_list(struct list_head *head)
-{
- border_t *x;
- list_for_each_entry(border_t, x, head, list) {
- assert(x->magic == BORDER_FOURCC);
- }
-}
-
-static void check_heads(be_chordal_env_t *env)
-{
- pmap_entry *ent;
- for (ent = pmap_first(env->border_heads); ent; ent = pmap_next(env->border_heads)) {
- /* ir_printf("checking border list of block %+F\n", ent->key); */
- check_border_list(ent->value);
- }
-}
-#endif
-
static int get_next_free_reg(const be_chordal_alloc_env_t *alloc_env, bitset_t *colors)
{
bitset_t *tmp = alloc_env->tmp_colors;
bitset_clear_all(bs);
bitset_copy(bs, op->regs);
bitset_and(bs, out_op->regs);
- n_total = bitset_popcnt(op->regs) + bitset_popcnt(out_op->regs);
+ n_total = bitset_popcount(op->regs) + bitset_popcount(out_op->regs);
if (!bitset_is_empty(bs) && n_total < smallest_n_regs) {
smallest = i;
int *assignment;
pmap *partners;
int i, n_alloc;
- bitset_pos_t col;
+ unsigned col;
const ir_edge_t *edge;
ir_node *perm = NULL;
//int match_res, cost;
match_res = hungarian_solve(bp, assignment, &cost, 1);
assert(match_res == 0 && "matching failed");
#else
+ /*bipartite_dump_f(stderr, bp);*/
bipartite_matching(bp, assignment);
#endif
const arch_register_t *reg;
ir_node *irn;
- assert(assignment[i] >= 0 && "there must have been a register assigned");
+ assert(assignment[i] >= 0 && "there must have been a register assigned (node not register pressure faithful?)");
reg = arch_register_for_index(env->cls, assignment[i]);
assert(! (reg->type & arch_register_type_ignore));
env.in_colors = bitset_alloca(colors_n);
env.pre_colored = pset_new_ptr_default();
- BE_TIMER_PUSH(t_constr);
+ be_timer_push(T_CONSTR);
/* Handle register targeting constraints */
dom_tree_walk_irg(irg, constraints, NULL, &env);
be_dump(chordal_env->irg, buf, dump_ir_block_graph_sched);
}
- BE_TIMER_POP(t_constr);
+ be_timer_pop(T_CONSTR);
env.live = bitset_malloc(get_irg_last_idx(chordal_env->irg));
del_pset(env.pre_colored);
}
+BE_REGISTER_MODULE_CONSTRUCTOR(be_init_chordal);
void be_init_chordal(void)
{
- FIRM_DBG_REGISTER(dbg, "firm.be.chordal");
-
static be_ra_chordal_coloring_t coloring = {
be_ra_chordal_color
};
+ FIRM_DBG_REGISTER(dbg, "firm.be.chordal");
be_register_chordal_coloring("default", &coloring);
}
-
-BE_REGISTER_MODULE_CONSTRUCTOR(be_init_chordal);