Open dcharkes opened 3 years ago
A follow up from the discussion with @cskau-g earlier this week. FFI leaf calls are not being inlined (CL).
out/ReleaseX64/dart --trace-inlining benchmarks/FfiCall/dart/FfiCall.dart // slightly modified Inlining calls in doCall1Int8 Depth 1 ---------- Polymorphic Instance Calls (0) Static Calls (1) => function1Int8 (deopt count 0) Success with reason AlwaysInline, code size 2, call sites: 0 Closure Calls (1) Bailout: non-closure operator
https://github.com/dart-lang/sdk/blob/3bcae5219b91f4b12d063779b44233ceffc4cf32/runtime/vm/compiler/backend/inliner.cc#L1476-L1493
The receiver is a static load:
Callee graph for inlining file:///usr/local/google/home/dacoharkes/dart-sdk/sdk/benchmarks/FfiCall/dart/FfiCall.dart_::_get_function1Int8 (optimized) ==== file:///usr/local/google/home/dacoharkes/dart-sdk/sdk/benchmarks/FfiCall/dart/FfiCall.dart_::_get_function1Int8 (ImplicitStaticGetter) B0[graph]:0 { v23 <- Constant(#null) v24 <- Constant(#<optimized out>) } B6[function entry]:2 v25 <- LoadStaticField:4(function1Int8) T{_Closure} Return:6(v25)
We should investigate whether we can make leaf ffi calls being inlined.
When enabling inlining we will have to restore EmitMoveConst which was deleted by https://dart-review.googlesource.com/c/sdk/+/227741
EmitMoveConst
A follow up from the discussion with @cskau-g earlier this week. FFI leaf calls are not being inlined (CL).
https://github.com/dart-lang/sdk/blob/3bcae5219b91f4b12d063779b44233ceffc4cf32/runtime/vm/compiler/backend/inliner.cc#L1476-L1493
The receiver is a static load:
We should investigate whether we can make leaf ffi calls being inlined.