X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=ir%2Fbe%2Fbespillbelady.c;h=25fc7902f8b21af2a9ccaf9a4d83075206fda1ca;hb=e882b686518c16d814ee7c317f59b686b1cb5d08;hp=658b34d23a28f05f6165490473d3abd6f603aab1;hpb=1b9805188655599d297e3fd36fe4d20017b33263;p=libfirm diff --git a/ir/be/bespillbelady.c b/ir/be/bespillbelady.c index 658b34d23..25fc7902f 100644 --- a/ir/be/bespillbelady.c +++ b/ir/be/bespillbelady.c @@ -28,7 +28,6 @@ #include #include "obst.h" -#include "irprintf_t.h" #include "irgraph.h" #include "irnode.h" #include "irmode.h" @@ -39,6 +38,7 @@ #include "irprintf.h" #include "irnodeset.h" #include "irtools.h" +#include "statev_t.h" #include "util.h" #include "beutil.h" @@ -482,11 +482,6 @@ static loc_t to_take_or_not_to_take(ir_node* first, ir_node *node, loc.node = node; loc.spilled = false; - if (!arch_irn_consider_in_reg_alloc(cls, node)) { - loc.time = USES_INFINITY; - return loc; - } - /* We have to keep nonspillable nodes in the workingset */ if (arch_get_irn_flags(skip_Proj_const(node)) & arch_irn_flags_dont_spill) { loc.time = 0; @@ -603,9 +598,8 @@ static void decide_start_workset(const ir_node *block) } /* check all Live-Ins */ - be_lv_foreach(lv, block, be_lv_state_in, node) { + be_lv_foreach_cls(lv, block, be_lv_state_in, cls, node) { unsigned available; - if (all_preds_known) { available = available_in_all_preds(pred_worksets, arity, node, false); } else { @@ -804,7 +798,6 @@ static void process_block(ir_node *block) new_vals = new_workset(); sched_foreach(block, irn) { - int i, arity; assert(workset_get_length(ws) <= n_regs); /* Phis are no real instr (see insert_starters()) */ @@ -818,14 +811,10 @@ static void process_block(ir_node *block) /* allocate all values _used_ by this instruction */ workset_clear(new_vals); - for (i = 0, arity = get_irn_arity(irn); i < arity; ++i) { - ir_node *in = get_irn_n(irn, i); - if (!arch_irn_consider_in_reg_alloc(cls, in)) - continue; - + be_foreach_use(irn, cls, in_req_, in, in_req, /* (note that "spilled" is irrelevant here) */ workset_insert(new_vals, in, false); - } + ); displace(new_vals, 1); /* allocate all values _defined_ by this instruction */