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:
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 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/regalloc2luaJIT
- https://github.com/LuaJIT/LuaJIT/