-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
[mono][interp] Add some missing opcodes for cfold #99055
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
|
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.
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.
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.
* [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 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