i965/vs: Detect GRF sources in split_virtual_grfs send-from-GRF code.
i965/vs: Detect GRF sources in split_virtual_grfs send-from-GRF code.

It is incorrect to assume that src[0] of a SEND-from-GRF opcode is the GRF.
VS_OPCODE_PULL_CONSTANT_LOAD_GEN7 uses an IMM as src[0], and stores the
GRF as src[1].

To be safe, loop over all the source registers and mark any GRFs.  We
probably won't ever have more than one, but it's simpler to just check
all three rather than attempting to bail early.

Fixes assertion failures in Unigine Sanctuary since we started making
register allocation rely on split_virtual_grfs working.  (The register
classes were actually sufficient, we were just interpreting an IMM as
a virtual GRF number.)

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=68637
Signed-off-by: Kenneth Graunke <bd2562f754ec92342f93f61c25d731e290a2ffa8@whitecape.org>
Reviewed-by: Eric Anholt <96f164ad4d9b2b0dacf8ebee2bb1eeb3aa69adf1@anholt.net>
Cc: 59f39c0db42d4479a46b02d4d2bc11120e37bb44@lists.freedesktop.org

jbarczak/glsl-optimizer,dellis1972/glsl-optimizer,djreep81/glsl-optimizer,dellis1972/glsl-optimizer,wolf96/glsl-optimizer,bkaradzic/glsl-optimizer,mcanthony/glsl-optimizer,mapbox/glsl-optimizer,zeux/glsl-optimizer,metora/MesaGLSLCompiler,mapbox/glsl-optimizer,jbarczak/glsl-optimizer,zeux/glsl-optimizer,wolf96/glsl-optimizer,zz85/glsl-optimizer,djreep81/glsl-optimizer,tokyovigilante/glsl-optimizer,jbarczak/glsl-optimizer,wolf96/glsl-optimizer,jbarczak/glsl-optimizer,zz85/glsl-optimizer,mapbox/glsl-optimizer,mapbox/glsl-optimizer,mcanthony/glsl-optimizer,zz85/glsl-optimizer,benaadams/glsl-optimizer,benaadams/glsl-optimizer,wolf96/glsl-optimizer,benaadams/glsl-optimizer,mcanthony/glsl-optimizer,mcanthony/glsl-optimizer,bkaradzic/glsl-optimizer,dellis1972/glsl-optimizer,djreep81/glsl-optimizer,dellis1972/glsl-optimizer,zeux/glsl-optimizer,dellis1972/glsl-optimizer,bkaradzic/glsl-optimizer,metora/MesaGLSLCompiler,zz85/glsl-optimizer,zeux/glsl-optimizer,zeux/glsl-optimizer,mapbox/glsl-optimizer,djreep81/glsl-optimizer,zz85/glsl-optimizer,tokyovigilante/glsl-optimizer,metora/MesaGLSLCompiler,zz85/glsl-optimizer,benaadams/glsl-optimizer,tokyovigilante/glsl-optimizer,tokyovigilante/glsl-optimizer,wolf96/glsl-optimizer,benaadams/glsl-optimizer,jbarczak/glsl-optimizer,tokyovigilante/glsl-optimizer,benaadams/glsl-optimizer,bkaradzic/glsl-optimizer,bkaradzic/glsl-optimizer,mcanthony/glsl-optimizer,djreep81/glsl-optimizer