anv: Use nir_opt_barrier_modes() to drop unnecessary barriers

fossil-db stats on Alchemist:

   Totals:
   Instrs: 196514947 -> 196513342 (-0.00%); split: -0.00%, +0.00%
   Cycles: 14271450761 -> 14271426028 (-0.00%); split: -0.00%, +0.00%
   Send messages: 8022316 -> 8021892 (-0.01%)

   Totals from 43 (0.01% of 653252) affected shaders:
   Instrs: 98558 -> 96953 (-1.63%); split: -1.63%, +0.00%
   Cycles: 15867801 -> 15843068 (-0.16%); split: -0.17%, +0.02%
   Send messages: 8997 -> 8573 (-4.71%)

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24842>
This commit is contained in:
Kenneth Graunke 2023-08-22 10:40:40 -07:00 committed by Marge Bot
parent 2b14618daa
commit 9f98f20c58

View file

@ -2008,6 +2008,8 @@ anv_pipeline_nir_preprocess(struct anv_pipeline *pipeline,
NIR_PASS(_, stage->nir, nir_remove_dead_variables, nir_var_shader_out, NULL);
}
NIR_PASS(_, stage->nir, nir_opt_barrier_modes);
nir_shader_gather_info(stage->nir, nir_shader_get_entrypoint(stage->nir));
}