X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=ir%2Fbe%2Fbestate.c;h=1967fb5f71186d662fb5de3133256159f0ebe746;hb=b4647d67ab7885d5da32c2a30242fbc4ed93d81b;hp=c83bc6cb2e3b7b8ddf93ca81965e11850a38b300;hpb=ea75e9d38674b468f602a0699fb64b9c01254797;p=libfirm diff --git a/ir/be/bestate.c b/ir/be/bestate.c index c83bc6cb2..1967fb5f7 100644 --- a/ir/be/bestate.c +++ b/ir/be/bestate.c @@ -161,6 +161,7 @@ static void spill_phi(minibelady_env_t *env, ir_node *phi) ir_node *block = get_nodes_block(phi); int arity = get_irn_arity(phi); ir_node **in = ALLOCAN(ir_node*, arity); + ir_node *dummy = new_r_Dummy(irg, mode_M); ir_node *spill_to_kill = NULL; spill_info_t *spill_info; int i; @@ -175,7 +176,7 @@ static void spill_phi(minibelady_env_t *env, ir_node *phi) /* create a new phi-M with bad preds */ for (i = 0; i < arity; ++i) { - in[i] = new_r_Unknown(irg, mode_M); + in[i] = dummy; } DBG((dbg, LEVEL_2, "\tcreate Phi-M for %+F\n", phi)); @@ -461,7 +462,7 @@ static ir_node *get_end_of_block_insertion_point(ir_node *block) if (!is_cfop(last)) { last = sched_next(last); /* last node must be a cfop, only exception is the start block */ - assert(last == get_irg_start_block(get_irn_irg(block))); + assert(last == get_irg_start_block(get_irn_irg(block))); } return last; @@ -507,7 +508,7 @@ static void fix_block_borders(ir_node *block, void *data) pred_info->end_state, need_state)); if (pred_info->end_state != need_state) { - ir_node *insert_point = get_end_of_block_insertion_point(pred); + ir_node *insert_point = get_end_of_block_insertion_point(pred); DBG((dbg, LEVEL_3, " Creating reload for %+F\n", need_state)); @@ -516,14 +517,13 @@ static void fix_block_borders(ir_node *block, void *data) } } -void be_assure_state(be_irg_t *birg, const arch_register_t *reg, void *func_env, +void be_assure_state(ir_graph *irg, const arch_register_t *reg, void *func_env, create_spill_func create_spill, create_reload_func create_reload) { minibelady_env_t env; - ir_graph *irg = be_get_birg_irg(birg); spill_info_t *info; - be_lv_t *lv = be_assure_liveness(birg); + be_lv_t *lv = be_assure_liveness(irg); be_liveness_assure_sets(lv); /* construct control flow loop tree */ @@ -536,7 +536,7 @@ void be_assure_state(be_irg_t *birg, const arch_register_t *reg, void *func_env, env.func_env = func_env; env.create_spill = create_spill; env.create_reload = create_reload; - env.lv = be_get_birg_liveness(birg); + env.lv = be_get_irg_liveness(irg); env.uses = be_begin_uses(irg, env.lv); env.spills = NULL; ir_nodemap_init(&env.spill_infos); @@ -560,7 +560,7 @@ void be_assure_state(be_irg_t *birg, const arch_register_t *reg, void *func_env, int i, len; ir_node **phis; - be_ssa_construction_init(&senv, birg); + be_ssa_construction_init(&senv, irg); if (sched_is_scheduled(info->value)) be_ssa_construction_add_copy(&senv, info->value); be_ssa_construction_add_copies(&senv, @@ -592,7 +592,7 @@ void be_assure_state(be_irg_t *birg, const arch_register_t *reg, void *func_env, } /* some nodes might be dead now. */ - be_remove_dead_nodes_from_schedule(birg); + be_remove_dead_nodes_from_schedule(irg); ir_nodemap_destroy(&env.spill_infos); be_end_uses(env.uses);