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

Make BinaryInt64OpInstr not deoptimize on 32-bit platforms for multiplication #31878

Closed
mkustermann opened this Issue Jan 12, 2018 · 3 comments

Comments

2 participants
@mkustermann
Member

mkustermann commented Jan 12, 2018

Currently the BinaryInt64OpInstr can deoptimize for Token::kMUL, which means we can't use it in AOT.

/cc @mraleph @mkustermann

@mkustermann mkustermann added the area-vm label Jan 12, 2018

@mraleph mraleph changed the title from Make BinaryInt64OpInstr not deoptimize on ARM for multiplication to Make BinaryInt64OpInstr not deoptimize on 32-bit platforms for multiplication Feb 14, 2018

@aartbik aartbik self-assigned this Jul 25, 2018

@aartbik

This comment has been minimized.

Show comment
Hide comment
@aartbik

aartbik Jul 25, 2018

Contributor

Important to allow this operation on AOT. But JIT also pays a price of course when it hits the deopt path.
Using a toy benchmark:

JIT-X64 (all is well):
executed in 0:00:00.077319 (7 * 11 = 77)
executed in 0:00:00.059761 (7 * 12384898975268875 = 86694292826882125)
executed in 0:00:00.059642 (7881299347898375 * 12384898975268875 = 173388585653764173)

JIT-IA32 (ouch):
executed in 0:00:00.072529 (7 * 11 = 77)
executed in 0:00:10.591828 (7 * 12384898975268875 = 86694292826882125)
executed in 0:00:10.757459 (7881299347898375 * 12384898975268875 = 173388585653764173)

Contributor

aartbik commented Jul 25, 2018

Important to allow this operation on AOT. But JIT also pays a price of course when it hits the deopt path.
Using a toy benchmark:

JIT-X64 (all is well):
executed in 0:00:00.077319 (7 * 11 = 77)
executed in 0:00:00.059761 (7 * 12384898975268875 = 86694292826882125)
executed in 0:00:00.059642 (7881299347898375 * 12384898975268875 = 173388585653764173)

JIT-IA32 (ouch):
executed in 0:00:00.072529 (7 * 11 = 77)
executed in 0:00:10.591828 (7 * 12384898975268875 = 86694292826882125)
executed in 0:00:10.757459 (7881299347898375 * 12384898975268875 = 173388585653764173)

@aartbik

This comment has been minimized.

Show comment
Hide comment
@aartbik

aartbik Jul 26, 2018

Contributor

I have an IA32 implementation.

JIT-IA32 (no more ouch):
executed in 0:00:00.059797 (7 * 11 = 77)
executed in 0:00:00.060428 (7 * 12384898975268875 = 86694292826882125)
executed in 0:00:00.048630 (7881299347898375 * 12384898975268875 = 173388585653764173)

Contributor

aartbik commented Jul 26, 2018

I have an IA32 implementation.

JIT-IA32 (no more ouch):
executed in 0:00:00.059797 (7 * 11 = 77)
executed in 0:00:00.060428 (7 * 12384898975268875 = 86694292826882125)
executed in 0:00:00.048630 (7881299347898375 * 12384898975268875 = 173388585653764173)

@aartbik

This comment has been minimized.

Show comment
Hide comment
@aartbik

aartbik Jul 26, 2018

Contributor

Also a train-large run-small example:

JIT-X64:
executed in 0:00:03.130512 (large vars) : -5294617979206500352
executed in 0:00:01.418314 (small vars) : 20250000000

JIT-IA32:
executed in 0:00:05.397772 (large vars) : -5294617979206500352
executed in 0:00:07.332302 (small vars) : 20250000000

Contributor

aartbik commented Jul 26, 2018

Also a train-large run-small example:

JIT-X64:
executed in 0:00:03.130512 (large vars) : -5294617979206500352
executed in 0:00:01.418314 (small vars) : 20250000000

JIT-IA32:
executed in 0:00:05.397772 (large vars) : -5294617979206500352
executed in 0:00:07.332302 (small vars) : 20250000000

dart-bot pushed a commit that referenced this issue Jul 26, 2018

[vm/compiler] Non-speculative IA32 long multiplication.
Rationale:
The former speculative long multiplication on 32-bit
achitectures is no longer necessary with 64-bit
arithmetic wrap-around semantics. Having a non-speculative
implementation avoids deopting under JIT and enables AOT.

#31878

Change-Id: Iedd641304b10d2bf55fc1f283eccdba4a836423c
Reviewed-on: https://dart-review.googlesource.com/66942
Commit-Queue: Aart Bik <ajcbik@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>

dart-bot pushed a commit that referenced this issue Jul 27, 2018

[vm/compiler] Non-speculative ARM long multiplication.
Rationale:
The former speculative long multiplication on 32-bit
achitectures is no longer necessary with 64-bit
arithmetic wrap-around semantics. Having a non-speculative
implementation avoids deopting under JIT and enables AOT.

#31878

Change-Id: I3543e5ed63e443aa21c1af84499e46c07880d462
Reviewed-on: https://dart-review.googlesource.com/67084
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
Commit-Queue: Aart Bik <ajcbik@google.com>

@aartbik aartbik closed this Jul 27, 2018

Modern Dart VM Pipeline automation moved this from To Do to Done Jul 27, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment