Well written code will use lots of local, temporary variables. The more efficient the allocator the fewer and smaller the spills to the stack. So, yeah, register allocation is important _because_ of finite memory bandwidth and latency.
Posted Sep 23, 2011 10:31 UTC (Fri) by etienne (subscriber, #25256)
[Link]
Register allocation is also very complex if you target Intel/AMD processors, with their 8/16/32 or 8/32/64 registers size: if the lower 8 bits (AL) are taken you can still use the upper 8 bits (AH), but then using the 16/32 bits register (AX/EAX) makes register allocation very complex.
Most code use boolean variables, and using 32/64 bits to store a boolean is very inefficient on Intel/AMD processor.
I wonder if LLVM is able to coalesce multiple boolean into a single register and use bits-and/or/test to manage them, I didn't see GCC doing it nicely (and it is probably very complex to implement).