r600g/sb: relax register allocation for compute shaders
authorVadim Girlin <vadimgirlin@gmail.com>
Fri, 24 May 2013 14:07:55 +0000 (18:07 +0400)
committerVadim Girlin <vadimgirlin@gmail.com>
Fri, 24 May 2013 17:00:54 +0000 (21:00 +0400)
commit5a68a29706002cd9f59faeb3ce18e7aed8a74201
treeff165f477aab158108badbee9f168e7039cf877f
parent0b5b3f8816f9cb5a2b2259176b4c7dd9e4d31233
r600g/sb: relax register allocation for compute shaders

We have to assume that all GPRs in compute shader can be indirectly
addressed because LLVM backend doesn't provide any indirect array info.
That's why for compute shaders GPR array is created that covers all used
GPRs (0..r600_bytecode::ngpr-1), but this seriously restricts register
allocation in sb.

This patch checks for actual use of indirect access in the shader and
if it's not used then GPR array is not created, so that regalloc is not
unnecessarily restricted.

Signed-off-by: Vadim Girlin <vadimgirlin@gmail.com>
src/gallium/drivers/r600/sb/sb_bc.h
src/gallium/drivers/r600/sb/sb_bc_parser.cpp