nir: Optimize uniform vote_all and vote_any

No shader-db changes on any Intel platform.

fossil-db:

All Ice Lake and newer platforms had similar results. (Ice Lake)
Totals:
Instrs: 165513303 -> 165511820 (-0.00%)
Cycles: 15125314947 -> 15125211500 (-0.00%); split: -0.00%, +0.00%

Totals from 82 (0.01% of 656120) affected shaders:
Instrs: 544627 -> 543144 (-0.27%)
Cycles: 22616493 -> 22513046 (-0.46%); split: -0.46%, +0.00%

No fossil-db changes on Gfx9.

Suggested-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27044>
This commit is contained in:
Ian Romanick 2024-01-05 10:27:38 -08:00
parent 535caaf3e0
commit a2292f53b5

View file

@ -29,6 +29,8 @@ opt_uniform_subgroup_filter(const nir_instr *instr, const void *_state)
case nir_intrinsic_quad_swap_diagonal:
case nir_intrinsic_quad_swizzle_amd:
case nir_intrinsic_masked_swizzle_amd:
case nir_intrinsic_vote_all:
case nir_intrinsic_vote_any:
return !nir_src_is_divergent(intrin->src[0]);
case nir_intrinsic_reduce: