diff --git a/zjit/src/hir.rs b/zjit/src/hir.rs index 23dddf35e6133f..fb5beb04044998 100644 --- a/zjit/src/hir.rs +++ b/zjit/src/hir.rs @@ -7469,6 +7469,7 @@ impl Function { // on inlining passes. If we reach the max, we run the loop one more time with inlining // disabled in order to optimize the results of the last inlining operation. let inline_max_iterations = get_option!(inline_max_iterations); + let mut has_inlined = false; for iteration in 0..=inline_max_iterations { // Function is assumed to have types inferred already run_pass!(type_specialize); @@ -7479,6 +7480,7 @@ impl Function { } else { false }; + has_inlined |= did_inline; run_pass!(convert_no_profile_sends); run_pass!(remove_trivial_block_params); run_pass!(optimize_load_store); @@ -7487,7 +7489,9 @@ impl Function { run_pass!(clean_cfg); run_pass!(remove_redundant_patch_points); run_pass!(remove_duplicate_check_interrupts); - run_pass!(eliminate_empty_inline_frames); + if has_inlined { + run_pass!(eliminate_empty_inline_frames); + } run_pass!(eliminate_dead_code); if !did_inline {