I've been working on patches to improve subregister liveness tracking on llvm and I wanted to inform the llvm community about the overal design/motivation for them. I will send the patches to llvm-commits later today.
Subregisters in llvm
I have a question about the way sub-registers are spilled and restored that is related to the changes I made in r192119.
Suppose I have the following piece of code with four instructions. %vreg0 and %vreg1 consist of two sub-registers indexed by sub_lo and sub_hi.
instr0 %vreg0instr1 %vreg1:sub_lo<def,read-undef>
If register allocator decides to insert spill and restore instructions for %vreg0, will it spill the whole register that includes sub-registers lo and hi?
Or will it spill just the lo sub-register?
If it spills the whole register (both sub-registers lo and hi), the changes I made should be fine. Otherwise, I will have to find another way to prevent the problems I mentioned in r192119’s commit log.