In case of more than wavesize CSR SGPR spills, lanes of reserved VGPR were getting
overwritten due to wrap around.
Reserve a VGPR (when NumVGPRSpillLanes = 0, WaveSize, 2*WaveSize, ..) and when one
of the two conditions is true:
- One reserved VGPR being tracked by VGPRReservedForSGPRSpill is not yet reserved.
- All spill lanes of reserved VGPR(s) are full and another spill lane is required.
I think it might be clearer to split out the logic for the special reserved case.
Could you do something like