[mono][interp] Lower div.un to shr.un.imm#83498
Merged
Merged
Conversation
Generate sub opcode instead which is detected by other optimizations.
|
Tagging subscribers to this area: @BrzVlad, @kotlarmilos Issue DetailsIf divisor is power of 2.
|
kg
reviewed
Mar 16, 2023
| #endif | ||
| td->sp -= 2; | ||
| interp_ins_set_sregs2 (td->last_ins, td->sp [1].local, td->sp [0].local); | ||
| push_simple_type (td, STACK_TYPE_I); |
Contributor
There was a problem hiding this comment.
The original interp opcode looks like it was storing the result of a signed pointer subtraction into an unsigned int (mono_u), but I assume this will behave correctly as-is?
kg
approved these changes
Mar 16, 2023
kotlarmilos
reviewed
Mar 16, 2023
|
|
||
| interp_clear_ins (def); | ||
| interp_clear_ins (ins); | ||
| local_ref_count [sreg_imm]--; |
Member
There was a problem hiding this comment.
Probably mono_interp_stats.super_instructions++; is missing
Member
Author
There was a problem hiding this comment.
Some of these stats are not that useful anymore, I will probably get rid of them in the future. Also this is more of a peephole optimization. This pass will probably end up being rebranded.
This was referenced Mar 23, 2023
Closed
Closed
Closed
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
If divisor is power of 2.