X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=ir%2Fbe%2Fbechordal.c;h=a32d509b6991ec6fad35538f1cf5ce7d016a8038;hb=d0d5cc041a1bdc5a62aab757dbf7d3069796c63a;hp=5a119e7975e0fb0a3f235936fdb7e937dfae2a3b;hpb=61ca019f49b71d23c4c55f3c47d7868480269fc0;p=libfirm diff --git a/ir/be/bechordal.c b/ir/be/bechordal.c index 5a119e797..a32d509b6 100644 --- a/ir/be/bechordal.c +++ b/ir/be/bechordal.c @@ -84,25 +84,6 @@ typedef struct _be_chordal_alloc_env_t { 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; @@ -167,7 +148,7 @@ static void pair_up_operands(const be_chordal_alloc_env_t *alloc_env, be_insn_t 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; @@ -198,7 +179,7 @@ static ir_node *handle_constraints(be_chordal_alloc_env_t *alloc_env, 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; @@ -351,6 +332,7 @@ static ir_node *handle_constraints(be_chordal_alloc_env_t *alloc_env, 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 @@ -359,7 +341,7 @@ static ir_node *handle_constraints(be_chordal_alloc_env_t *alloc_env, 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)); @@ -575,7 +557,7 @@ void be_ra_chordal_color(be_chordal_env_t *chordal_env) 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); @@ -585,7 +567,7 @@ void be_ra_chordal_color(be_chordal_env_t *chordal_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)); @@ -607,15 +589,13 @@ void be_ra_chordal_color(be_chordal_env_t *chordal_env) 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);