Implement register allocation system
- Dominant language
- Rust
- Stars
- 28
- Forks
- 1
- PR merge metrics
- No merged PRs in 30d
Description
This will be needed for implementing custom backends like the VM and (potentially in the future other architecture backends like `x86`).
It should be agnostic to a backend, and can just output information about which liveness intervals, and which physical registers should be assigned to what locals.
The conditions for the register allocator to run are that:
- the IR has finished optimisations
- the IR is in SSA form
The register allocator will likely implement the Linear Scan Register Allocation algorithm (https://link.springer.com/content/pdf/10.1007/3-540-45937-5_17.pdf).
Some implementation references are:
- `regalloc2` - https://github.com/bytecodealliance/regalloc2
- `luaJIT` - https://github.com/LuaJIT/LuaJIT/
Contributor guide
Assessment
This issue has not been assessed yet.