Skip to content

Commit

Permalink
Instruction deletion should delete usage, not add
Browse files Browse the repository at this point in the history
Thinko found while looking into unexpectedly leftover instruction
usages in the graph.
  • Loading branch information
jnthn committed Jul 9, 2018
1 parent 2f88d0e commit 901ccf7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/spesh/manipulate.c
Expand Up @@ -100,7 +100,7 @@ void MVM_spesh_manipulate_cleanup_ins_deps(MVMThreadContext *tc, MVMSpeshGraph *
MVMint32 i;
MVM_spesh_get_facts(tc, g, ins->operands[0])->dead_writer = 1;
for (i = 1; i < ins->info->num_operands; i++)
MVM_spesh_usages_add_by_reg(tc, g, ins->operands[i], ins);
MVM_spesh_usages_delete_by_reg(tc, g, ins->operands[i], ins);
}
else {
MVMint32 i;
Expand All @@ -109,7 +109,7 @@ void MVM_spesh_manipulate_cleanup_ins_deps(MVMThreadContext *tc, MVMSpeshGraph *
if (rw == MVM_operand_write_reg)
MVM_spesh_get_facts(tc, g, ins->operands[i])->dead_writer = 1;
else if (rw == MVM_operand_read_reg)
MVM_spesh_usages_add_by_reg(tc, g, ins->operands[i], ins);
MVM_spesh_usages_delete_by_reg(tc, g, ins->operands[i], ins);
}
}
}
Expand Down

0 comments on commit 901ccf7

Please sign in to comment.