gpu-compute: Add granulated SGPR computation for gfx9

The granulated SGPR size is used when the number of SGPRs is unknown.
The computation for this has changed since gfx8 and is commented as a
TODO in a comment.

This changeset implements the change and also checks for an invalid SGPR
count. According to LLVM code this could happen "due to a compiler bug
or when using inline asm.":

Change-Id: Ie487a53940b323a0002341075e0f81af4147a7d8
Maintainer: Matt Sinclair <>
Reviewed-by: Matt Sinclair <>
Tested-by: kokoro <>
1 file changed