Further strengthen the type-based optimizations #5688
Merged
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.
Building on #5316 and #5664, this pull request annotates more arithmetic instructions with type information to allow the JIT to generate better code.
With this PR, the compiler and the JIT can now optimize a tuple used as a lookup table such as in the following example (similar to real code in the
base64module):Because
Nis known to be an integer in the range 1 through 4, the JIT will omit all type and range checks and generate inlined code to fetch theNth element of the tuple.