r600/sfn: run nir_opt_idiv_const

Suggested by Emma.

This reduces the number of ALU groups in the query result shader by
more than 50%.

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41328>
This commit is contained in:
Gert Wollny 2026-05-23 23:44:20 +02:00 committed by Marge Bot
parent fc582adfcb
commit b22315f9a9

View file

@ -697,6 +697,8 @@ r600_finalize_nir_common(nir_shader *nir, enum amd_gfx_level gfx_level)
NIR_PASS(_, nir, nir_lower_flrp, nir_lower_flrp_mask, false);
NIR_PASS(_, nir, nir_opt_idiv_const, 64);
NIR_PASS(_, nir, nir_opt_idiv_const, 32);
nir_lower_idiv_options idiv_options = {0};
NIR_PASS(_, nir, nir_lower_idiv, &idiv_options);
@ -719,6 +721,7 @@ r600_finalize_nir_common(nir_shader *nir, enum amd_gfx_level gfx_level)
NIR_PASS(_, nir, r600_lower_shared_io);
NIR_PASS(_, nir, r600_nir_lower_atomics);
static const nir_lower_subgroups_options r600_nir_subgroups_options = {
.ballot_bit_size = 32,
.ballot_components = 1,