diff --git a/zjit.rb b/zjit.rb index 2196d0890e3..c677197e3cd 100644 --- a/zjit.rb +++ b/zjit.rb @@ -185,6 +185,7 @@ class << RubyVM::ZJIT :compile_hir_clean_cfg_time_ns, :compile_hir_remove_redundant_patch_points_time_ns, :compile_hir_remove_duplicate_check_interrupts_time_ns, + :compile_hir_eliminate_empty_inline_frames_time_ns, :compile_hir_eliminate_dead_code_time_ns, :compile_lir_time_ns, :profile_time_ns, diff --git a/zjit/src/hir.rs b/zjit/src/hir.rs index 6c6019d4307..d82c938032b 100644 --- a/zjit/src/hir.rs +++ b/zjit/src/hir.rs @@ -7711,6 +7711,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_ever_inlined = false; for iteration in 0..=inline_max_iterations { // Function is assumed to have types inferred already run_pass!(type_specialize); @@ -7729,7 +7730,10 @@ impl Function { run_pass!(clean_cfg); run_pass!(remove_redundant_patch_points); run_pass!(remove_duplicate_check_interrupts); - run_pass!(eliminate_empty_inline_frames); + has_ever_inlined |= did_inline; + if has_ever_inlined { + run_pass!(eliminate_empty_inline_frames); + } run_pass!(eliminate_dead_code); if !did_inline {