v3d: Avoid assertion failures when removing end-of-shader instructions.
authorEric Anholt <eric@anholt.net>
Tue, 11 Dec 2018 22:07:52 +0000 (14:07 -0800)
committerEric Anholt <eric@anholt.net>
Sat, 15 Dec 2018 01:48:01 +0000 (17:48 -0800)
commita7e15a50866cf6bff1114d6e34ee8beab23ee7bb
tree9c2cded5063d54d80b468eab5205715de0ed915e
parent5b2cc038522de2bd4b522d6376aef34c65af02d5
v3d: Avoid assertion failures when removing end-of-shader instructions.

After generating VIR, we leave c->cursor pointing at the end of the
shader.  If the shader had dead code at the end (for example from preamble
instructions in a shader with no side effects), we would assertion fail
that we were leaving the cursor pointing at freed memory.  Since anything
following DCE should be setting up a new cursor anyway, just clear the
cursor at the start.
src/broadcom/compiler/vir_opt_dead_code.c