nir: Add a helper for general instruction-modifying passes.
authorEric Anholt <eric@anholt.net>
Thu, 20 Aug 2020 18:43:29 +0000 (11:43 -0700)
committerMarge Bot <eric+marge@anholt.net>
Thu, 27 Aug 2020 23:01:52 +0000 (23:01 +0000)
commita62098fff202f5e6c689aa6e78ace67c50f17c8e
treee342d97106d0df9edcd04dccd4cfcfb46555f3a6
parenta82f664d0a4968cfc123be03e1608f430a99231b
nir: Add a helper for general instruction-modifying passes.

The nir_shader_lower_instructions() is really nice, but it's only for SSA
operations, and sometimes you want something more general.  I've put it in
nir_builder.h so it can be inlined and retain the same performance
characteristics we're used to in our lowering passes even in the absence
of LTO.

Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6412>
src/compiler/nir/nir_builder.h