X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=ir%2Fbe%2Fbechordal.c;h=d9d5506b007f1fca15302cabcdb982362eb67ba5;hb=d300330b1e6df8c8914b8fb70cf38ee1c8ca2634;hp=23782670029f9479ae1654c8fd924130cee67598;hpb=96c886ce8da63a60b748a182aae2ce042abb6fe8;p=libfirm diff --git a/ir/be/bechordal.c b/ir/be/bechordal.c index 237826700..d9d5506b0 100644 --- a/ir/be/bechordal.c +++ b/ir/be/bechordal.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 1995-2007 University of Karlsruhe. All right reserved. + * Copyright (C) 1995-2008 University of Karlsruhe. All right reserved. * * This file is part of libFirm. * @@ -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; @@ -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); @@ -1012,6 +1012,8 @@ 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); + /* Handle register targeting constraints */ dom_tree_walk_irg(irg, constraints, NULL, &env); @@ -1020,6 +1022,8 @@ 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); + env.live = bitset_malloc(get_irg_last_idx(chordal_env->irg)); /* First, determine the pressure */