From 3ab29ffca0ba78e28c02c5c49660570e75a41f6c Mon Sep 17 00:00:00 2001 From: Mel Henning Date: Tue, 20 May 2025 19:53:30 -0400 Subject: [PATCH] nak: Use nir membar optimizations Call nir_opt_barrier_modes and nir_opt_acquire_release_barriers. Totals: CodeSize: 5750619392 -> 5750618656 (-0.00%) Number of GPRs: 16276896 -> 16276898 (+0.00%) Static cycle count: 1497053946 -> 1497053776 (-0.00%); split: -0.00%, +0.00% Spills to reg: 9143000 -> 9143006 (+0.00%) Fills from reg: 6892354 -> 6892360 (+0.00%) Totals from 14 (0.01% of 196502) affected shaders: CodeSize: 786432 -> 785696 (-0.09%) Number of GPRs: 1294 -> 1296 (+0.15%) Static cycle count: 153230 -> 153060 (-0.11%); split: -0.14%, +0.03% Spills to reg: 1360 -> 1366 (+0.44%) Fills from reg: 947 -> 953 (+0.63%) Part-of: --- src/nouveau/compiler/nak_nir.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/nouveau/compiler/nak_nir.c b/src/nouveau/compiler/nak_nir.c index 4e583e8dab9..cbc236b45ef 100644 --- a/src/nouveau/compiler/nak_nir.c +++ b/src/nouveau/compiler/nak_nir.c @@ -327,6 +327,9 @@ nak_preprocess_nir(nir_shader *nir, const struct nak_compiler *nak) /* Optimize but allow copies because we haven't lowered them yet */ optimize_nir(nir, nak, true /* allow_copies */); + OPT(nir, nir_opt_barrier_modes); + OPT(nir, nir_opt_acquire_release_barriers, SCOPE_QUEUE_FAMILY); + OPT(nir, nir_lower_load_const_to_scalar); OPT(nir, nir_lower_var_copies); OPT(nir, nir_lower_system_values);