nir/repair_ssa: Repair dominance for unreachable blocks
authorJason Ekstrand <jason@jlekstrand.net>
Mon, 2 Sep 2019 17:54:31 +0000 (12:54 -0500)
committerJason Ekstrand <jason@jlekstrand.net>
Fri, 6 Sep 2019 23:39:01 +0000 (23:39 +0000)
commita3268599f3c9bb1d92571e15df95750a06114811
tree6bd228dbd76cb9721f7a173eeeb2cf73b03e8891
parentf81a2623d82ccad6177fe1fe5b80a6398df29b6e
nir/repair_ssa: Repair dominance for unreachable blocks

NIR currently assumes that unreachable blocks are trivially dominated by
everything.  However, when considering well-formed SSA, there is no path
from any block to an unreachable block.  Therefore, we can break any
use-def chains where the use is in an unreachable block.  This removes
any dependencies on code created by uses in unreachable blocks and lets
DCE do a better job of cleaning it up.

Cc: mesa-stable@lists.freedesktop.org
Reviewed-by: Caio Marcelo de Oliveira Filho <caio.oliveira@intel.com>
src/compiler/nir/nir_repair_ssa.c