[mono][interp] Add some missing opcodes for cfold#99055
Merged
BrzVlad merged 1 commit intodotnet:mainfrom Feb 29, 2024
Merged
Conversation
This regression was introduced by SSA change. Before SSA change we were adding superinstructions at the very end of the compilation process, we would never encounter super instructions during cprop phase when cfolding takes place. This is no longer the case so we need to be able to fold patterns like `ct + add.imm`. Fixes Normalize ASCII regression from wasm bench suite
|
Tagging subscribers to this area: @BrzVlad, @kotlarmilos Issue DetailsThis regression was introduced by SSA change. Before SSA change we were adding superinstructions at the very end of the compilation process, so we would never encounter super instructions during cprop phase when cfolding takes place. This is no longer the case so we need to be able to fold patterns like Fixes Normalize ASCII regression from wasm bench suite
|
vargaz
approved these changes
Feb 28, 2024
BrzVlad
added a commit
to BrzVlad/runtime
that referenced
this pull request
Mar 5, 2024
We will avoid running it if we know will do another iteration later (especially useful when first iteration is ssa disabled). It can still happen for it to run multiple times (when bblock optimization requests retry), but this should be very rare. This will save compilation time and should also remove the necessity of handling super instructions in constant folding pass. Reverts dotnet#99055 since it is no longer necessary.
BrzVlad
added a commit
to BrzVlad/runtime
that referenced
this pull request
Mar 5, 2024
We will avoid running it if we know will do another iteration later (especially useful when first iteration is ssa disabled). It can still happen for it to run multiple times (when bblock optimization requests retry), but this should be very rare. This will save compilation time and should also remove the necessity of handling super instructions in constant folding pass. Reverts dotnet#99055 since it is no longer necessary.
BrzVlad
added a commit
to BrzVlad/runtime
that referenced
this pull request
Mar 6, 2024
We will avoid running it if we know will do another iteration later (especially useful when first iteration is ssa disabled). It can still happen for it to run multiple times (when bblock optimization requests retry), but this should be very rare. This will save compilation time and should also remove the necessity of handling super instructions in constant folding pass. Reverts dotnet#99055 since it is no longer necessary.
BrzVlad
added a commit
that referenced
this pull request
Mar 7, 2024
* [mono][interp] Remove most of hardcoded LDC instructions They have little benefit. Also fix oversight which resulted in using MINT_LDC_I4_S only for byte sized integers. * [mono][interp] Refactor fetching of immediate value for superinstructions Make `get_sreg_imm` more flexible, by returning the immediate value and the mint type that this value can fit in. Simplify return immediate handling by also applying conversion to immediate value, if necessary. * [mono][interp] Avoid running super instruction pass more than once We will avoid running it if we know will do another iteration later (especially useful when first iteration is ssa disabled). It can still happen for it to run multiple times (when bblock optimization requests retry), but this should be very rare. This will save compilation time and should also remove the necessity of handling super instructions in constant folding pass. Reverts #99055 since it is no longer necessary. * [mono][interp] Add a few super instructions with 32 bit immediates Also add instructions for and/or + immediates. * [mono][interp] Fix MINT_SHL_AND_ generation and + ldc will already be transformed to a superinstruction, so this can also be simplified. * Implement new superinsns in jiterpreter * [mono][interp] Add explicit cast for clarity --------- Co-authored-by: Katelyn Gadd <kg@luminance.org> Co-authored-by: Larry Ewing <lewing@microsoft.com>
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.
This regression was introduced by SSA change. Before SSA change we were adding superinstructions at the very end of the compilation process, so we would never encounter super instructions during cprop phase when cfolding takes place. This is no longer the case so we need to be able to fold patterns like
ct + add.imm.Fixes Normalize ASCII regression from wasm bench suite