It must be solved in LLVM, not mesa. You can use my forward-ported llvm git branch if you need register spilling: https://github.com/darkbasic/llvm