From 6fa5e95f4c22bfd94e6b68988ec021f9df138016 Mon Sep 17 00:00:00 2001 From: Matthias Braun Date: Fri, 27 May 2011 14:41:42 +0200 Subject: [PATCH] merge start-block successor with start-block in backend (necessary after equivalent_node_Block is gone) --- ir/be/beabi.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/ir/be/beabi.c b/ir/be/beabi.c index 5944a7362..55da37b17 100644 --- a/ir/be/beabi.c +++ b/ir/be/beabi.c @@ -1558,6 +1558,21 @@ static void fix_start_block(ir_graph *irg) assert(is_Proj(initial_X)); exchange(initial_X, jmp); set_irg_initial_exec(irg, new_r_Bad(irg, mode_X)); + + /* merge start block with successor if possible */ + { + const ir_edge_t *edge; + foreach_out_edge(jmp, edge) { + ir_node *succ = get_edge_src_irn(edge); + if (!is_Block(succ)) + continue; + + if (get_irn_arity(succ) == 1) { + exchange(succ, start_block); + } + break; + } + } } /** -- 2.20.1