nir: Add and use nir_foreach_block_unstructured helpers
authorJason Ekstrand <jason@jlekstrand.net>
Tue, 11 Aug 2020 19:13:36 +0000 (14:13 -0500)
committerMarge Bot <eric+marge@anholt.net>
Fri, 14 Aug 2020 20:35:36 +0000 (20:35 +0000)
commit92db942fc6af52ea5a4a3eb77533a045ffe56685
treeab91ff99b3d80b302f2cf3b2dea5a8a4a93817f4
parent4768ea1a77ad7559004949d0cf1eb7af9a4499d9
nir: Add and use nir_foreach_block_unstructured helpers

These are safe to call on either structured or unstructured NIR but
don't provide the nice ordering guarantees of nir_foreach_block and
friends.  While we're here, we use them for a very small selection of
passes which are known to be safe for unstructured control-flow.  The
most important such pass is nir_dominance which is required for
structurizing.

Signed-off-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/2401>
src/compiler/nir/nir.c
src/compiler/nir/nir.h
src/compiler/nir/nir_deref.c
src/compiler/nir/nir_dominance.c