2 ms·
One of the hardest parts of writing a compiler is register allocation. Not quite. There are many much more difficult problems in a competitive optimizing compi
by dmpk2k 14y ago
One of the hardest parts of writing a compiler is register allocation.
Not quite. There are many much more difficult problems in a competitive optimizing compiler before hitting that step.
You can get reasonable results from even a linear scan allocator, which is simple.
- aidenn0 14y agoIt really depends on the architecture. There are some architectures with only 1 register, and others with many thousands of registers. Current x86 implementations do a good job of being fast even when registers spill. I've seen dual-issue Power cores (32ish registers) that only have 16k of 4-way dcache, which means register spills can easily kill performance.