jit: Optimize instructions based on operand types#5316
Merged
bjorng merged 6 commits intoerlang:masterfrom Nov 10, 2021
Merged
Conversation
92de295 to
f55528d
Compare
a95138a to
7f5a51c
Compare
Co-authored-by: Björn Gustavsson <bjorn@erlang.org>
7f5a51c to
a030d5d
Compare
Co-authored-by: Björn Gustavsson <bjorn@erlang.org>
Co-authored-by: Björn Gustavsson <bjorn@erlang.org>
Hoisting the fun check outside these loops lets us skip error checks on the fun calls themselves, which is very nice for functions like foldl/3.
13c2ad4 to
3346acf
Compare
Contributor
|
This diff breaks the following example. Can someone please look into this. I think it is failing for larger integers. |
Contributor
|
@itssundeep Thanks, I have created an issue to make sure that we don't forget to fix the bug. |
bjorng
added a commit
to bjorng/otp
that referenced
this pull request
Nov 17, 2021
The type-based optimizations introduced in 3617610 (erlang#5316) could cause `divint` and `rem` instructions to be fused when it was not safe. Closes erlang#5401.
bjorng
added a commit
to bjorng/otp
that referenced
this pull request
Nov 18, 2021
The type-based optimizations introduced in 3617610 (erlang#5316) could cause `int` and `rem` instructions to be fused when it was not safe. Closes erlang#5401.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR lets the JIT optimize instructions by their operand types. The current implementation settles for removing redundant tag tests and the like, but we plan to add more aggressive optimizations in the near future, such as reducing arithmetic to single machine instructions when we've determined they can't overflow.