nir: remove jump from two merging jump-ending blocks
authorJuan A. Suarez Romero <jasuarez@igalia.com>
Tue, 12 Feb 2019 12:02:42 +0000 (12:02 +0000)
committerJuan A. Suarez Romero <jasuarez@igalia.com>
Fri, 15 Feb 2019 14:16:24 +0000 (15:16 +0100)
commit1fb24080b7da8c1378c7aabc2d02ffece677ce7c
treed4e09939c129175296c4068b56715d98591ed0ea
parent69be9934a780eadc7c0b64465fae8431eb979dae
nir: remove jump from two merging jump-ending blocks

In opt_peel_initial_if optimization, when moving the continue list to
end of the continue block, before the jump, could happen that the
continue list itself also ends with a jump.

This would mean that we would have two jump instructions in a row: the
first one from the continue list and the second one from the contine
block.

As inserting an instruction after a jump is not allowed (and it does not
make sense, as it will not be executed), remove the jump from the
continue block and keep the one from continue list, as it will be
executed first.

CC: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-by: Caio Marcelo de Oliveira Filho <caio.oliveira@intel.com>
src/compiler/nir/nir_opt_if.c