gallium/ttn: don't upset nir_validate w/ BRK's
authorRob Clark <robclark@freedesktop.org>
Fri, 26 Jun 2015 18:24:08 +0000 (14:24 -0400)
committerRob Clark <robclark@freedesktop.org>
Tue, 30 Jun 2015 16:13:44 +0000 (12:13 -0400)
commit879dcf07f6a3ab56f23d540b0df94c57e0706094
tree452742210920e393f8c044733c86affc2bc6ea62
parentd1f0e019797863b23388bfef53a77f659f749d3c
gallium/ttn: don't upset nir_validate w/ BRK's

Previously we were unconditionally doing ttn_get_src() even for
instructions with no src's.  Which created a lot of unnecessary
load_const instructions.  These were mostly harmless since NIR opt
passes would strip them back out.  But for an ENDIF following a
BRK, it would result in load_const instructions created after the
NIR break instruction.  Which nir_validate dislikes.

But we can actually just dtrt by using NumSrcRegs instead.

Signed-off-by: Rob Clark <robclark@freedesktop.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
src/gallium/auxiliary/nir/tgsi_to_nir.c