File tree 1 file changed +8
-4
lines changed
1 file changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -315,11 +315,15 @@ and should_inline
315
315
&& (functor_like ~env p info
316
316
|| (live_vars.(Var. idx info.f) = 1
317
317
&&
318
- (* Avoid inlining in loop since, if the loop is not hot, the
319
- code might not be optimized *)
320
318
match Config. target () with
321
- | `Wasm when in_loop -> body_size info ~env p < 30 && not (contains_loop info p)
322
- | _ -> body_size info ~env p < 150 )
319
+ | `Wasm when in_loop ->
320
+ (* Avoid inlining in loop since, if the loop is not hot, the
321
+ code might not be optimized *)
322
+ body_size info ~env p < 30 && not (contains_loop info p)
323
+ | _ ->
324
+ body_size info ~env p < 150
325
+ (* Avoid inlining loops at toplevel *)
326
+ && ((not (contains_loop info p)) || Option. is_some current_function))
323
327
|| (body_size info ~env p < = 1 && closure_count info ~env p = 0 )
324
328
|| small_function
325
329
~live_vars
You can’t perform that action at this time.
0 commit comments