From a298ccb8610baeb13b62184c7f6607554e397285 Mon Sep 17 00:00:00 2001 From: Sebastian Hack Date: Tue, 7 Aug 2007 15:24:14 +0000 Subject: [PATCH] Handle ignore nodes as operands of Phis (Unknowns for example) [r15495] --- ir/be/bespillbelady2.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/ir/be/bespillbelady2.c b/ir/be/bespillbelady2.c index 6551b1ae6..5240d3e21 100644 --- a/ir/be/bespillbelady2.c +++ b/ir/be/bespillbelady2.c @@ -823,6 +823,7 @@ end: static double can_bring_in(global_end_state_t *ges, ir_node *bl, ir_node *irn, double limit, int level) { + belady_env_t *env = ges->env; double glob_costs = HUGE_VAL; DBG((dbg, DBG_GLOBAL, "\t%2Dcan bring in for %+F at block %+F\n", level, irn, bl)); @@ -837,7 +838,16 @@ static double can_bring_in(global_end_state_t *ges, ir_node *bl, ir_node *irn, d for (i = 0; i < n; ++i) { ir_node *pr = get_Block_cfgpred_block(bl, i); ir_node *op = is_local_phi(bl, irn) ? get_irn_n(irn, i) : irn; - double c = can_make_available_at_end(ges, pr, op, limit, level + 1); + double c; + + /* + * there might by unknwons as operands of phis in that case + * we set the costs to zero, since they won't get spilled. + */ + if (arch_irn_consider_in_reg_alloc(env->arch, env->cls, op)) + c = can_make_available_at_end(ges, pr, op, limit, level + 1); + else + c = 0.0; glob_costs += c; -- 2.20.1