Open
Description
Following #43681 and #46037, the interpreter allows for additional improvements. This issue tracks additional improvements that we plan to do, loosely ordered by their priority. This list will be updated with additional improvements that are deemed useful.
Optimizations Done
- Enable inlining of methods that throw exceptions [interp] Inline more AggressiveInlining methods #48513
- Add our own var offset allocator, moving away from the current one based on IL stack. This improves the flexibility of future optimizations. [interp] Rework the allocation of offsets for variables #49072
- Optimize MINT_NEWOBJ opcodes. Remove memcpy of args, allow for optimizing them out. [interp] Rework the allocation of offsets for variables #49072
- Add superinstructions for binop + imm, also for ret + imm [interp] Add a few super instructions #50361
- Additional superinstructions and optimizations [interp] Add more super instructions and other small optimizations #51273
- Remove abort protection of finally blocks [interp] Remove abort protection of finally blocks #51309
- Remove MINT_CHECKPOINT generation. Add superinstructions for branches [interp] Optimize conditional branches #52130
- Optimize passing of global call arguments [interp] Squash multiple call args moves into single opcode #52242
- Replace compare + brtrue/brfalse pattern with binop conditional branch Remove mono specific SpanHelpers #79215 and [mono][interp] Expand compare + brfalse/brtrue with single conditional branch opcode #80046
- Fix bblock removal to account for loops Remove mono specific SpanHelpers #79215
- Vector128 SIMD intrinsics [mono][interp] Add instrinsics for common Vector128 operations #81782
- Implement SSA so we can more easily implement most of the optimizations below [mono][interp] Add SSA transformation and SSA based optimization #96315
- Track the value of global vars over multiple basic blocks [mono][interp] Add SSA transformation and SSA based optimization #96315
- Remove uses of MINT_INITLOCALS, since almost every local is initialized explicitly by code [mono][interp] Add SSA transformation and SSA based optimization #96315
Planned optimizations
- Loop unrolling
- Struct field promotion
- Constant propagation of string literals
- Move constant declaration from common paths to their use location
- Improve inlining heuristic
- Additional hardware / numerics intrinsics
- Optimize out unnecessary MINT_CKNULL, by tracking nullability of some vars
- Optimize out empty finally blocks
- Loop-invariant hoisting
- Better track type of vars and remove redundant CONV opcodes