From a2292f53b525a751d32a7114a3152ab4be0e2d5c Mon Sep 17 00:00:00 2001 From: Ian Romanick Date: Fri, 5 Jan 2024 10:27:38 -0800 Subject: [PATCH] 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 Reviewed-by: Lionel Landwerlin Part-of: --- src/compiler/nir/nir_opt_uniform_subgroup.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/compiler/nir/nir_opt_uniform_subgroup.c b/src/compiler/nir/nir_opt_uniform_subgroup.c index 6018b1d0156..64c7075e78d 100644 --- a/src/compiler/nir/nir_opt_uniform_subgroup.c +++ b/src/compiler/nir/nir_opt_uniform_subgroup.c @@ -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: