cowgol
cowgol copied to clipboard
All values are written back to memory even when they're unused
There's no way to mark a variable as being killed, i.e. that the value will never be read from again; this means the code generator always has to write them back to memory when the register gets flushed even if it's a waste.
The easy fix (of adding a KILL iop for doing this) is problematic because some iops flush all registers --- consider BEQ.
But annotating the iops themselves is hard because temporaries only get freed after the iop is emitted.
This is partially implemented; KILL iops are ignored for comparisons and branches. It's had a small effect on code size only, which was a bit disappointing.