intel/compiler: Use NIR_PASS instead of NIR_PASS_V
authorIan Romanick <ian.d.romanick@intel.com>
Wed, 11 Jan 2023 19:15:27 +0000 (11:15 -0800)
committerMarge Bot <emma+marge@anholt.net>
Thu, 6 Apr 2023 19:07:50 +0000 (19:07 +0000)
Reduce debug log spam by only logging the shader if a pass made some
changes. This can also elide some nir_validate calls in debug builds.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22299>

src/intel/compiler/brw_fs.cpp
src/intel/compiler/brw_nir.c

index 8a43516..8d2db7e 100644 (file)
@@ -7481,11 +7481,11 @@ brw_compile_fs(const struct brw_compiler *compiler,
        * offset to determine render target 0 store instruction in
        * emit_alpha_to_coverage pass.
        */
-      NIR_PASS_V(nir, nir_opt_constant_folding);
-      NIR_PASS_V(nir, brw_nir_lower_alpha_to_coverage, key, prog_data);
+      NIR_PASS(_, nir, nir_opt_constant_folding);
+      NIR_PASS(_, nir, brw_nir_lower_alpha_to_coverage, key, prog_data);
    }
 
-   NIR_PASS_V(nir, brw_nir_move_interpolation_to_top);
+   NIR_PASS(_, nir, brw_nir_move_interpolation_to_top);
    brw_postprocess_nir(nir, compiler, true, debug_enabled,
                        key->base.robust_buffer_access);
 
index faa9662..9f5d2c6 100644 (file)
@@ -1649,7 +1649,7 @@ brw_postprocess_nir(nir_shader *nir, const struct brw_compiler *compiler,
    OPT(nir_opt_move, nir_move_comparisons);
    OPT(nir_opt_dead_cf);
 
-   NIR_PASS_V(nir, nir_convert_to_lcssa, true, true);
+   NIR_PASS(_, nir, nir_convert_to_lcssa, true, true);
    NIR_PASS_V(nir, nir_divergence_analysis);
 
    /* TODO: Enable nir_opt_uniform_atomics on Gfx7.x too.