X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=ir%2Fbe%2Fbespillbelady.c;h=ad654a7fb63c39d49becf2d704af6b774f620f08;hb=64252961a7d41265ff28353949e63f0662a1cd03;hp=6b249f50455c22ffe3412a775f8ee5ed2b1f2ae3;hpb=7e447b3efcd7b0e79c6746da340416206331d18d;p=libfirm diff --git a/ir/be/bespillbelady.c b/ir/be/bespillbelady.c index 6b249f504..ad654a7fb 100644 --- a/ir/be/bespillbelady.c +++ b/ir/be/bespillbelady.c @@ -89,7 +89,6 @@ static unsigned n_regs; static workset_t *ws; /**< the main workset used while processing a block. */ static be_uses_t *uses; /**< env for the next-use magic */ -static ir_node *instr; /**< current instruction */ static spill_env_t *senv; /**< see bespill.h */ static ir_node **blocklist; @@ -324,7 +323,7 @@ static unsigned get_distance(ir_node *from, const ir_node *def, int skip_from_us * @p is_usage indicates that the values in new_vals are used (not defined) * In this case reloads must be performed */ -static void displace(workset_t *new_vals, int is_usage) +static void displace(workset_t *const new_vals, int const is_usage, ir_node *const instr) { ir_node **to_insert = ALLOCAN(ir_node*, n_regs); bool *spilled = ALLOCAN(bool, n_regs); @@ -806,16 +805,13 @@ static void process_block(ir_node *block) } DB((dbg, DBG_DECIDE, " ...%+F\n", irn)); - /* set instruction in the workset */ - instr = irn; - /* allocate all values _used_ by this instruction */ workset_clear(new_vals); 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); + displace(new_vals, 1, irn); /* allocate all values _defined_ by this instruction */ workset_clear(new_vals); @@ -823,7 +819,7 @@ static void process_block(ir_node *block) assert(req->width == 1); workset_insert(new_vals, value, false); ); - displace(new_vals, 0); + displace(new_vals, 0, irn); } /* Remember end-workset for this block */