hash-org / hashc

The Hash programming language compiler :zap:
https://hash-org.github.io/hashc/
MIT License
25 stars 2 forks source link

Implement register allocation system #1028

Open feds01 opened 11 months ago

feds01 commented 11 months ago

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: