Mesa (master): radv: run nir_opt_shrink_load

Samuel Pitoiset hakzsam at kemper.freedesktop.org
Tue Feb 6 22:11:14 UTC 2018


Module: Mesa
Branch: master
Commit: 3488a3f0332ba1d77e2c4609a26206e77922e81b
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=3488a3f0332ba1d77e2c4609a26206e77922e81b

Author: Samuel Pitoiset <samuel.pitoiset at gmail.com>
Date:   Mon Jan 29 17:19:18 2018 +0100

radv: run nir_opt_shrink_load

LLVM can't shrink loads.

Polaris10:
Totals from affected shaders:
SGPRS: 62528 -> 59955 (-4.11 %)
VGPRS: 44708 -> 44616 (-0.21 %)
Spilled SGPRs: 16 -> 8 (-50.00 %)
Code Size: 1355504 -> 1355172 (-0.02 %) bytes
Max Waves: 11710 -> 11670 (-0.34 %)

Vega10:
Totals from affected shaders:
SGPRS: 51448 -> 50371 (-2.09 %)
VGPRS: 39140 -> 39048 (-0.24 %)
Spilled SGPRs: 16 -> 16 (0.00 %)
Code Size: 1307188 -> 1304296 (-0.22 %) bytes
Max Waves: 11312 -> 11292 (-0.18 %)

This reduces SGPRs spilling in MadMax, and it also reduces
number of SGPRs in DOW3 and F12017. The number of waves slightly
decreases in F1 but I don't see any performance changes after
benchmarking it. Talos and Serious Sam are not affected because
they don't use any push constants.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset at gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas at basnieuwenhuizen.nl>

---

 src/amd/vulkan/radv_shader.c                                            | 2 ++
 .../nir/{nir_opt_shrink_load_constant.c => nir_opt_shrink_load.c}       | 0
 2 files changed, 2 insertions(+)

diff --git a/src/amd/vulkan/radv_shader.c b/src/amd/vulkan/radv_shader.c
index af094e6220..42f83bb335 100644
--- a/src/amd/vulkan/radv_shader.c
+++ b/src/amd/vulkan/radv_shader.c
@@ -148,6 +148,8 @@ radv_optimize_nir(struct nir_shader *shader)
                         NIR_PASS(progress, shader, nir_opt_loop_unroll, 0);
                 }
         } while (progress);
+
+        NIR_PASS(progress, shader, nir_opt_shrink_load);
 }
 
 nir_shader *
diff --git a/src/compiler/nir/nir_opt_shrink_load_constant.c b/src/compiler/nir/nir_opt_shrink_load.c
similarity index 100%
rename from src/compiler/nir/nir_opt_shrink_load_constant.c
rename to src/compiler/nir/nir_opt_shrink_load.c




More information about the mesa-commit mailing list