Skip to content

Commit

Permalink
Remove more pointless gotos
Browse files Browse the repository at this point in the history
We will remove empty basic blocks in merge_bbs later on, so no harm in
creating them.
  • Loading branch information
niner committed Jan 19, 2018
1 parent f65c6e2 commit a70dd94
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions src/spesh/optimize.c
Expand Up @@ -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;
Expand Down

0 comments on commit a70dd94

Please sign in to comment.