Alamvic / druid

Meta-compiler to generate an optimised JIT compiler frontend based on an Interpreter definition
8 stars 6 forks source link

Copy propagation of special registers #103

Open guillep opened 8 months ago

guillep commented 8 months ago

Special registers are lowered in the backend and not exposed in during optimization. Thus, they cannot be optimized/propageted and so on.

Example

self MoveR: ReceiverResultReg R: Extra2Reg.
self AddCq: 10 R: Extra2Reg.

=>

self AddCq: 10 R: ReceiverResultReg.

Difficulty: Difficult

Requires some redesigns. Either

Moreover, writing to the ReceiverResultReg is tricky because you can only do it when you know you’re not going to fail…