nir: add nir_metadata_control_flow

Most passes want to preserve this specific combination of metadata, so let's add
an alias for the combination. The alias communicates that the control flow graph
is preserved, rather than a particular statement about e.g. dominance
preservation.

You don't need to understand dominance to write a simple
nir_shader_instructions_pass. And since you were going to cargo cult the
metadata anyway, this way you'll cargo cult a version you're more likely to
understand.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Acked-by: Karol Herbst <kherbst@redhat.com>
Reviewed-by: Konstantin Seurer <konstantin.seurer@gmail.com>
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/29745>
This commit is contained in:
Alyssa Rosenzweig 2024-06-16 16:26:19 -04:00
parent cfa5beeeab
commit 90b6dba772

View file

@ -3322,6 +3322,18 @@ typedef enum {
*/ */
nir_metadata_instr_index = 0x20, nir_metadata_instr_index = 0x20,
/** All control flow metadata
*
* This includes all metadata preserved by a pass that preserves control flow
* but modifies instructions. For example, a pass using
* nir_shader_instructions_pass will typically preserve this if it does not
* insert control flow.
*
* This is the most common metadata set to preserve, so it has its own alias.
*/
nir_metadata_control_flow = nir_metadata_block_index |
nir_metadata_dominance,
/** All metadata /** All metadata
* *
* This includes all nir_metadata flags except not_properly_reset. Passes * This includes all nir_metadata flags except not_properly_reset. Passes