Skip to content

Commit

Permalink
Remove superfluous DEOPT_ONE_INS annotation on some deconts
Browse files Browse the repository at this point in the history
In general decont may invoke, thus it carries a DEOPT_ONE_INS annotation.
However in cases were we know from the container spec, that it doesn't invoke,
we can remove that annotation again to keep the spesh graph a little cleaner.
  • Loading branch information
niner committed Feb 8, 2018
1 parent 0e73714 commit 4f69388
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions src/spesh/optimize.c
Expand Up @@ -660,6 +660,20 @@ static void optimize_decont(MVMThreadContext *tc, MVMSpeshGraph *g, MVMSpeshBB *
MVMSTable *stable = STABLE(obj_facts->type);
MVMContainerSpec const *contspec = stable->container_spec;
if (contspec && contspec->fetch_never_invokes && contspec->spesh) {
MVMSpeshAnn *ann = ins->annotations;
/* Remove deopt annotation since we know we won't invoke. */
if (ann && ann->type == MVM_SPESH_ANN_DEOPT_ONE_INS) {
ins->annotations = ann->next;
}
else {
while (ann) {
if (ann->next && ann->next->type == MVM_SPESH_ANN_DEOPT_ONE_INS) {
ann->next = ann->next->next;
break;
}
ann = ann->next;
}
}
contspec->spesh(tc, stable, g, bb, ins);
MVM_spesh_use_facts(tc, g, obj_facts);
}
Expand Down

0 comments on commit 4f69388

Please sign in to comment.