From e147c095b4daaf678a4bc611a3660c949944fedf Mon Sep 17 00:00:00 2001 From: Karol Herbst Date: Sun, 12 Apr 2026 19:45:43 +0200 Subject: [PATCH] nak: sink load_global This seem to hurt smaller shaders, but really helps a lot with some of the worst cases we have reducing spilling by quite a lot. Totals from 15249 (1.26% of 1212873) affected shaders: CodeSize: 332565024 -> 333294192 (+0.22%); split: -0.38%, +0.60% Number of GPRs: 1020912 -> 1017649 (-0.32%); split: -2.15%, +1.83% SLM Size: 114724 -> 90240 (-21.34%); split: -21.37%, +0.03% Static cycle count: 538619840 -> 537174408 (-0.27%); split: -0.88%, +0.61% Spills to memory: 46686 -> 38685 (-17.14%) Fills from memory: 46686 -> 38685 (-17.14%) Spills to reg: 21224 -> 20703 (-2.45%); split: -3.23%, +0.77% Fills from reg: 19768 -> 19327 (-2.23%); split: -2.87%, +0.64% Max warps/SM: 519248 -> 519768 (+0.10%); split: +1.10%, -1.00% --- src/nouveau/compiler/nak_nir.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/nouveau/compiler/nak_nir.c b/src/nouveau/compiler/nak_nir.c index 83d80bc20c4..7b8dbb17893 100644 --- a/src/nouveau/compiler/nak_nir.c +++ b/src/nouveau/compiler/nak_nir.c @@ -1375,6 +1375,7 @@ nak_postprocess_nir(nir_shader *nir, } while (progress); OPT(nir, nir_opt_move, nir_move_comparisons | nir_move_load_ubo); + OPT(nir, nir_opt_sink, nir_move_load_global); if (nak->sm < 70) { const nir_split_conversions_options split_conv_opts = {