X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=ir%2Fbe%2Fberaextern.c;h=5ffa98fc7296b13903575f44a99f440d43aaaa36;hb=87965f5c94d561cb15233b80711123f6edc80b30;hp=b70cc2dd0b61223812f6d077b29110c750f45a80;hpb=6981dd3274e6753e50f66c8cbe17b37bd41708e5;p=libfirm diff --git a/ir/be/beraextern.c b/ir/be/beraextern.c index b70cc2dd0..5ffa98fc7 100644 --- a/ir/be/beraextern.c +++ b/ir/be/beraextern.c @@ -75,6 +75,7 @@ alloc ::= node-nr reg-nr . #include "pset.h" #include "pmap.h" #include "bitset.h" +#include "raw_bitset.h" #include "irprintf_t.h" #include "irnode_t.h" @@ -202,7 +203,7 @@ static void handle_constraints_insn(be_raext_env_t *env, be_insn_t *insn) be_operand_t *op = &insn->ops[i]; if(op->has_constraints) { - ir_node *cpy = be_new_Copy(op->req.cls, env->irg, bl, op->carrier); + ir_node *cpy = be_new_Copy(op->req->cls, env->irg, bl, op->carrier); sched_add_before(insn->next_insn, cpy); edges_reroute(op->carrier, cpy, env->irg); } @@ -212,10 +213,10 @@ static void handle_constraints_insn(be_raext_env_t *env, be_insn_t *insn) be_operand_t *op = &insn->ops[i]; if(op->has_constraints) { - ir_node *cpy = be_new_Copy(op->req.cls, env->irg, bl, op->carrier); + ir_node *cpy = be_new_Copy(op->req->cls, env->irg, bl, op->carrier); sched_add_before(insn->irn, cpy); set_irn_n(insn->irn, op->pos, cpy); - be_set_constr_limited(cpy, BE_OUT_POS(0), &op->req); + be_set_constr_limited(cpy, BE_OUT_POS(0), op->req); } } } @@ -292,16 +293,16 @@ static void extract_vars_of_cls(be_raext_env_t *raenv) { * If yes, dump it to FILE raenv->f */ static INLINE void dump_constraint(be_raext_env_t *raenv, ir_node *irn, int pos) { - bitset_t *bs = bitset_alloca(raenv->cls->n_regs); - arch_register_req_t req; - - arch_get_register_req(raenv->aenv, &req, irn, pos); - if (arch_register_req_is(&req, limited)) { - int reg_nr; - req.limited(req.limited_env, bs); - reg_nr = bitset_next_set(bs, 0); + const arch_register_req_t *req; + + req = arch_get_register_req(raenv->aenv, irn, pos); + if (arch_register_req_is(req, limited)) { + unsigned reg_nr; + + reg_nr = rbitset_next(req->limited, 0, 1); fprintf(raenv->f, "<%d>", reg_nr); - assert(-1 == bitset_next_set(bs, reg_nr+1) && "Constraints with more than 1 possible register are not supported"); + assert(rbitset_popcnt(req->limited, raenv->cls->n_regs) <= 1 + && "Constraints with more than 1 possible register are not supported"); } } @@ -392,7 +393,7 @@ NextVar: ; static void dump_affinities_walker(ir_node *irn, void *env) { be_raext_env_t *raenv = env; - arch_register_req_t req; + const arch_register_req_t *req; int pos, max; be_var_info_t *vi1, *vi2; @@ -415,12 +416,15 @@ static void dump_affinities_walker(ir_node *irn, void *env) { /* should_be_equal constraints are affinites */ for (pos = 0, max = get_irn_arity(irn); posaenv, &req, irn, pos); + req = arch_get_register_req(raenv->aenv, irn, pos); - if (arch_register_req_is(&req, should_be_same) && arch_irn_is(raenv->aenv, req.other_same, ignore)) { - vi2 = be_get_var_info(req.other_same); + if (arch_register_req_is(req, should_be_same)) { + ir_node *other = get_irn_n(irn, req->other_same); + if(arch_irn_is(raenv->aenv, other, ignore)) { + vi2 = be_get_var_info(other); - fprintf(raenv->f, "(%d, %d, %d)\n", vi1->var_nr, vi2->var_nr, get_affinity_weight(irn)); + fprintf(raenv->f, "(%d, %d, %d)\n", vi1->var_nr, vi2->var_nr, get_affinity_weight(irn)); + } } } } @@ -540,7 +544,7 @@ static INLINE void var_add_spills_and_reloads(be_raext_env_t *raenv, int var_nr) mode = get_irn_mode(get_irn_n(spill, be_pos_Spill_val)); /* insert reloads and wire them arbitrary*/ - pset_foreach(vi->values, irn) + pset_foreach(vi->values, irn) { foreach_out_edge_safe(irn, edge, ne) { ir_node *reload, *src = edge->src; if (is_Phi(src) || be_is_Spill(src)) @@ -554,9 +558,10 @@ static INLINE void var_add_spills_and_reloads(be_raext_env_t *raenv, int var_nr) /* remember the reload */ pset_insert_ptr(reloads, reload); } + } /* correct the reload->spill pointers... */ - be_ssa_constr_set(dom_front, lv, spills); + be_ssa_constr_set_ignore(dom_front, lv, spills, NULL); /****** correct the variable <--> values mapping: ******