Permalink
Browse files

Set dead writer when deleting instructions also.

This helps get better code produced in the case where the default of
an optional parameter is used (various type checks on the default can
be thrown out).
  • Loading branch information...
jnthn committed Jun 14, 2017
1 parent 1f67f2f commit ec6d1cd7b960358396a02bc87f1bfed8dd32d147
Showing with 4 additions and 0 deletions.
  1. +4 −0 src/spesh/manipulate.c
View
@@ -47,6 +47,10 @@ void MVM_spesh_manipulate_delete_ins(MVMThreadContext *tc, MVMSpeshGraph *g, MVM
}
ins->annotations = ann_next;
}
/* If it was a write instruction, mark is as having a dead writer. */
if ((ins->info->operands[0] & MVM_operand_rw_mask) == MVM_operand_write_reg)
MVM_spesh_get_facts(tc, g, ins->operands[0])->dead_writer = 1;
}
void MVM_spesh_manipulate_insert_ins(MVMThreadContext *tc, MVMSpeshBB *bb, MVMSpeshIns *previous, MVMSpeshIns *to_insert) {

0 comments on commit ec6d1cd

Please sign in to comment.