-
Notifications
You must be signed in to change notification settings - Fork 1.7k
[vm/ffi] Enable inlining idempotent force-optimized functions #38985
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
We use force-optimized functions outside the FFI. It's a general optimization we'd like to do. Removing |
Also see https://dart-review.googlesource.com/c/sdk/+/210648 for the discussion of inlining force-optimized functions. |
In 243320 we're using |
@rmacnak-google @a-siva We discussed today that this optimization could also reduce the binary size overhead. We saw a ~50KB compressed increase in Flutter app size when switching the Engine to FFI natives. |
There will be some other things needed before |
…with 'vm:idempotent' pragma.w If inlined force-optimized function has to deoptimize, it deoptimizes to before-the-call. BUG=#38985 TEST=Inliner_InlineForceOptimized, Inliner_InlineAndRunForceOptimized Change-Id: I6aa4bf1b7ce4d19791132d252e01fc38394c9fcc Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/317522 Reviewed-by: Martin Kustermann <[email protected]> Reviewed-by: Slava Egorov <[email protected]> Commit-Queue: Alexander Aprelev <[email protected]> Reviewed-by: Alexander Markov <[email protected]>
This is follow-up to https://dart.googlesource.com/sdk/+/54234979a32368c2e6fe5a45468aae939ccc7700 BUG=#38985 TEST=ci CoreLibraryReviewExempt: vm-specific pragma Change-Id: Ib24d283634708902bbabfc750c7a4496745e69ab Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/321300 Commit-Queue: Alexander Aprelev <[email protected]> Reviewed-by: Martin Kustermann <[email protected]>
The
dart:ffi
memory operations are on par withdart:typed_data
in AoT, but roughly 4x slower in JiT on x64/ia32/arm64/arm.To get JiT in line, the indexed load/store should be made inlineable in unoptimized code. This is possible, even with code motion, because the index load/store are idempotent operations.
x64 measurements:
The text was updated successfully, but these errors were encountered: