Ignore Block->Block out edges when iterating over all out edges of a Block.
[libfirm] / ir / be / bechordal.c
index 00e3a7f..09c03a7 100644 (file)
@@ -157,7 +157,7 @@ static INLINE border_t *border_add(be_chordal_env_t *env, struct list_head *head
        else {
                b = get_irn_link(irn);
 
-               assert(b && b->magic == BORDER_FOURCC && "Illegal border encountered");
+               DEBUG_ONLY(assert(b && b->magic == BORDER_FOURCC && "Illegal border encountered"));
        }
 
        b->pressure = pressure;
@@ -293,6 +293,11 @@ static ir_node *prepare_constr_insn(be_chordal_env_t *env, ir_node *irn)
                        if(a_op->carrier != op->carrier || !a_op->has_constraints)
                                continue;
 
+                       /* if the constraint is the same, no copy is necessary
+                        * TODO generalise unequal but overlapping constraints */
+                       if (a_op->req == op->req)
+                               continue;
+
                        if (be_is_Copy(get_irn_n(insn->irn, a_op->pos)))
                                continue;
 
@@ -506,7 +511,7 @@ static ir_node *handle_constraints(be_chordal_alloc_env_t *alloc_env,
        bitset_pos_t col;
        const ir_edge_t *edge;
        ir_node *perm = NULL;
-       int match_res, cost;
+       //int match_res, cost;
        be_chordal_env_t *env  = alloc_env->chordal_env;
        void *base             = obstack_base(env->obst);
        be_insn_t *insn        = chordal_scan_insn(env, irn);
@@ -992,11 +997,6 @@ void be_ra_chordal_color(be_chordal_env_t *chordal_env)
 
        int colors_n          = arch_register_class_n_regs(cls);
        ir_graph *irg         = chordal_env->irg;
-       int allocatable_regs  = colors_n - be_put_ignore_regs(birg, cls, NULL);
-
-       /* some special classes contain only ignore regs, no work to be done */
-       if(allocatable_regs == 0)
-               return;
 
        be_assure_dom_front(birg);
        lv = be_assure_liveness(birg);