radv: use nir_opt_uniform_subgroup

Foz-DB Navi21:
Totals from 665 (0.68% of 97581) affected shaders:
MaxWaves: 12856 -> 12822 (-0.26%)
Instrs: 2073376 -> 2068645 (-0.23%); split: -0.23%, +0.00%
CodeSize: 11116904 -> 11098376 (-0.17%); split: -0.18%, +0.01%
VGPRs: 39584 -> 39568 (-0.04%); split: -0.20%, +0.16%
SpillSGPRs: 160 -> 155 (-3.12%)
SpillVGPRs: 2995 -> 2968 (-0.90%)
Latency: 15432093 -> 15503462 (+0.46%); split: -0.13%, +0.59%
InvThroughput: 3344411 -> 3351185 (+0.20%); split: -0.08%, +0.28%
VClause: 50278 -> 50225 (-0.11%); split: -0.15%, +0.04%
SClause: 57537 -> 57505 (-0.06%); split: -0.18%, +0.13%
Copies: 189642 -> 188175 (-0.77%); split: -0.86%, +0.08%
Branches: 68800 -> 68502 (-0.43%); split: -0.45%, +0.02%
PreSGPRs: 37646 -> 37068 (-1.54%)
PreVGPRs: 35891 -> 35943 (+0.14%)
VALU: 1386943 -> 1385881 (-0.08%); split: -0.09%, +0.01%
SALU: 287322 -> 284165 (-1.10%); split: -1.11%, +0.01%
VMEM: 90874 -> 90820 (-0.06%)

Acked-by: Marek Olšák <marek.olsak@amd.com>
Acked-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38902>
This commit is contained in:
Georg Lehmann
2025-12-11 10:59:14 +01:00
committed by Marge Bot
parent f57add1d14
commit ec81337d8d
+8
View File
@@ -473,6 +473,14 @@ radv_postprocess_nir(struct radv_device *device, const struct radv_graphics_stat
if (!radv_use_llvm_for_stage(pdev, stage->stage))
ac_nir_optimize_uniform_atomics(stage->nir);
NIR_PASS(_, stage->nir, nir_opt_uniform_subgroup,
&(struct nir_lower_subgroups_options){
.subgroup_size = stage->info.wave_size,
.ballot_bit_size = stage->info.wave_size,
.ballot_components = 1,
.lower_ballot_bit_count_to_mbcnt_amd = true,
});
NIR_PASS(_, stage->nir, nir_opt_idiv_const, 8);
NIR_PASS(_, stage->nir, nir_lower_idiv,