nir/dead_cf: Remove dead control flow after infinite loops.
authorBas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Fri, 11 Oct 2019 12:49:05 +0000 (14:49 +0200)
committerBas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Fri, 11 Oct 2019 15:24:26 +0000 (17:24 +0200)
commit6da3bf2600e52c16dac85439cb7eb5721e6c7b22
treebeec1d886d28183e6c4265e8153a709643853223
parentf13ad839f11aed68075b735ca0ac04ab9fecd154
nir/dead_cf: Remove dead control flow after infinite loops.

And after discard-only loops. Otherwise we end up with dead code
which confuses nir_repair_ssa into adding a whole bunch of uses
of undefined. However, for derefs, we sometimes always expect to
get a variable instead of undefined.

Fixes dEQP-VK.graphicsfuzz.write-red-in-loop-nest on radv.

Fixes: c832820ce95 "nir/dead_cf: Repair SSA if the pass makes progress"
Closes: https://gitlab.freedesktop.org/mesa/mesa/issues/1928
Reviewed-by: Connor Abbott <cwabbott0@gmail.com>
src/compiler/nir/nir_opt_dead_cf.c