gallium/ttn: fix cursor handling vs builder
authorRob Clark <robclark@freedesktop.org>
Wed, 9 Sep 2015 21:27:17 +0000 (17:27 -0400)
committerRob Clark <robclark@freedesktop.org>
Wed, 9 Sep 2015 21:34:47 +0000 (17:34 -0400)
commit9ce2e3072696428277988040908c9ae7a0abf9ad
tree1118ecc5f232492a175762cdfab052cbab5febde
parente50c01d5af305e07110cb4a38d5a655437058f04
gallium/ttn: fix cursor handling vs builder

After inserting instructions the cursor.option becomes _after_instr
(even if it started life as an _after_block).  So we cannot simply stash
the current cursor on the if/loop_stack.  Otherwise we end up inserting
instructions after the endif/endloop in the block preceeding the if/
loop.

Signed-off-by: Rob Clark <robclark@freedesktop.org>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
src/gallium/auxiliary/nir/tgsi_to_nir.c