diff --git a/src/spesh/optimize.c b/src/spesh/optimize.c index 3b0291a774..d7bb988901 100644 --- a/src/spesh/optimize.c +++ b/src/spesh/optimize.c @@ -28,6 +28,11 @@ static void log_inline(MVMThreadContext *tc, MVMSpeshGraph *g, MVMStaticFrame *t MVM_free(c_name_t); MVM_free(c_cuid_t); #endif + if (inline_graph && MVM_spesh_debug_enabled(tc)) { + char *dump = MVM_spesh_dump(tc, inline_graph); + MVM_spesh_debug_printf(tc, "Inlining graph\n%s\n", dump); + MVM_free(dump); + } } /* Obtains facts for an operand, just directly accessing them without @@ -1731,11 +1736,6 @@ static void optimize_call(MVMThreadContext *tc, MVMSpeshGraph *g, MVMSpeshBB *bb MVMSpeshGraph *inline_graph = MVM_spesh_inline_try_get_graph(tc, g, target_sf, target_sf->body.spesh->body.spesh_candidates[spesh_cand], ins, &no_inline_reason); - if (inline_graph != NULL && MVM_spesh_debug_enabled(tc)) { - char *dump = MVM_spesh_dump(tc, inline_graph); - MVM_spesh_debug_printf(tc, "Inlining graph\n%s\n", dump); - MVM_free(dump); - } log_inline(tc, g, target_sf, inline_graph, target_sf->body.spesh->body.spesh_candidates[spesh_cand]->bytecode_size, no_inline_reason);