nir/cf: Remove phi sources if needed in nir_handle_add_jump
authorJason Ekstrand <jason.ekstrand@intel.com>
Fri, 21 Sep 2018 14:27:48 +0000 (09:27 -0500)
committerJason Ekstrand <jason.ekstrand@intel.com>
Tue, 2 Oct 2018 15:24:56 +0000 (10:24 -0500)
commitbfc89c668e288747f51e447729914c91d27207e8
treefc17214d1a01a633c04d8ba13b0a388ec2d86cec
parent7b0752fb101ad1715cdc1c3424e11cda4aae6b23
nir/cf: Remove phi sources if needed in nir_handle_add_jump

If the block in which the jump is inserted is the predecessor of a phi
then we need to remove phi sources otherwise the phi may end up with
things improperly connected.  This fixes the following CTS test when
dEQP is run with SPIR-V optimization recipe 1:

dEQP-VK.glsl.functions.control_flow.return_in_nested_loop_vertex

Cc: mesa-stable@lists.freedesktop.org
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
src/compiler/nir/nir_control_flow.c