From 138b6f7fefad82016bec93c97de31397d1762f4b Mon Sep 17 00:00:00 2001 From: Christoph Mallon Date: Thu, 29 Nov 2012 08:37:12 +0100 Subject: [PATCH] bestate: Use be_get_end_of_block_insertion_point() instead of implementing something not entierly unlike it. --- ir/be/bestate.c | 23 ++--------------------- 1 file changed, 2 insertions(+), 21 deletions(-) diff --git a/ir/be/bestate.c b/ir/be/bestate.c index a15a61ce9..672e1cec6 100644 --- a/ir/be/bestate.c +++ b/ir/be/bestate.c @@ -48,6 +48,7 @@ #include "bemodule.h" #include "benode.h" #include "beirgmod.h" +#include "bespillutil.h" #include "bessaconstr.h" DEBUG_ONLY(static firm_dbg_module_t *dbg = NULL;) @@ -429,24 +430,6 @@ static void belady_walker(ir_node *block, void *data) belady((minibelady_env_t*) data, block); } -static ir_node *get_end_of_block_insertion_point(ir_node *block) -{ - ir_node *last = sched_last(block); - - /* skip Projs and Keep-alikes behind the jump... */ - while (is_Proj(last) || be_is_Keep(last)) { - last = sched_prev(last); - } - - 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))); - } - - return last; -} - /** * We must adapt the live-outs to the live-ins at each block-border. */ @@ -487,10 +470,8 @@ 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); - - DBG((dbg, LEVEL_3, " Creating reload for %+F\n", need_state)); + ir_node *const insert_point = be_get_end_of_block_insertion_point(pred); create_reload(env, need_state, insert_point, pred_info->end_state); } } -- 2.20.1