Skip to content

Commit

Permalink
Move PEA phase ahead of other post-inline opts
Browse files Browse the repository at this point in the history
So that we might get more `set` instructions eliminated
  • Loading branch information
jnthn committed Oct 9, 2018
1 parent 15ab517 commit dc36f75
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/spesh/optimize.c
Expand Up @@ -3240,6 +3240,11 @@ void MVM_spesh_optimize(MVMThreadContext *tc, MVMSpeshGraph *g, MVMSpeshPlanned

// merge_bbs(tc, g);

/* Perform partial escape analysis at this point, which may make more
* information available, or give more `set` instructions for the `set`
* elimination in the post-inline pass to get rid of. */
MVM_spesh_pea(tc, g);

/* Make a post-inline pass through the graph doing things that are better
* done after inlinings have taken place. Note that these things must not
* add new fact dependencies. Do a final dead instruction elimination pass
Expand All @@ -3249,9 +3254,6 @@ void MVM_spesh_optimize(MVMThreadContext *tc, MVMSpeshGraph *g, MVMSpeshPlanned
MVM_spesh_eliminate_dead_ins(tc, g);
MVM_spesh_eliminate_dead_bbs(tc, g, 1);

/* Perform partial escape analysis. */
MVM_spesh_pea(tc, g);

#if MVM_SPESH_CHECK_DU
MVM_spesh_usages_check(tc, g);
#endif
Expand Down

0 comments on commit dc36f75

Please sign in to comment.