also allow reference mode in fild
[libfirm] / ir / be / bechordal.c
index 54a9e1f..a32d509 100644 (file)
@@ -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));