From a70dd9474259d6b93ae0d21a6b4bcdd8057eeb52 Mon Sep 17 00:00:00 2001 From: Stefan Seifert Date: Thu, 18 Jan 2018 22:42:46 +0100 Subject: [PATCH] Remove more pointless gotos We will remove empty basic blocks in merge_bbs later on, so no harm in creating them. --- src/spesh/optimize.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/spesh/optimize.c b/src/spesh/optimize.c index 73a85f98f0..484c86490b 100644 --- a/src/spesh/optimize.c +++ b/src/spesh/optimize.c @@ -2401,10 +2401,7 @@ static void eliminate_pointless_gotos(MVMThreadContext *tc, MVMSpeshGraph *g) { && last_ins->info->opcode == MVM_OP_goto && last_ins->operands[0].ins_bb == cur_bb->linear_next ) { - if (last_ins == cur_bb->first_ins) // May not throw away the only instruction - last_ins->info = MVM_op_get_op(MVM_OP_no_op); - else - MVM_spesh_manipulate_delete_ins(tc, g, cur_bb, last_ins); + MVM_spesh_manipulate_delete_ins(tc, g, cur_bb, last_ins); } } cur_bb = cur_bb->linear_next;