nir/lower_subgroups: add option to only lower clustered rotates

On ir3, we have native support for full rotates but not for clustered
ones.

Signed-off-by: Job Noorman <jnoorman@igalia.com>
Reviewed-by: Connor Abbott <cwabbott0@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/31731>
This commit is contained in:
Job Noorman
2024-11-29 17:09:16 +01:00
committed by Marge Bot
parent eba6a70a66
commit d5d0628728
2 changed files with 5 additions and 0 deletions
+1
View File
@@ -6176,6 +6176,7 @@ typedef struct nir_lower_subgroups_options {
bool lower_elect : 1;
bool lower_read_invocation_to_cond : 1;
bool lower_rotate_to_shuffle : 1;
bool lower_rotate_clustered_to_shuffle : 1;
bool lower_ballot_bit_count_to_mbcnt_amd : 1;
bool lower_inverse_ballot : 1;
bool lower_reduce : 1;
+4
View File
@@ -1323,6 +1323,10 @@ lower_subgroups_instr(nir_builder *b, nir_instr *instr, void *_options)
if (options->lower_rotate_to_shuffle &&
(!options->lower_boolean_shuffle || intrin->src[0].ssa->bit_size != 1))
return lower_to_shuffle(b, intrin, options);
else if (options->lower_rotate_clustered_to_shuffle &&
nir_intrinsic_cluster_size(intrin) > 0 &&
(!options->lower_boolean_shuffle || intrin->src[0].ssa->bit_size != 1))
return lower_to_shuffle(b, intrin, options);
else if (options->lower_to_scalar && intrin->num_components > 1)
return lower_subgroup_op_to_scalar(b, intrin);
else if (options->lower_boolean_shuffle && intrin->src[0].ssa->bit_size == 1)