diff options
author | Samuel Pitoiset <samuel.pitoiset@gmail.com> | 2018-01-29 17:19:18 +0100 |
---|---|---|
committer | Samuel Pitoiset <samuel.pitoiset@gmail.com> | 2018-02-06 23:08:44 +0100 |
commit | 3488a3f0332ba1d77e2c4609a26206e77922e81b (patch) | |
tree | 732400c3f6e597d9c078eb48414914a8501c04f1 /src | |
parent | e68562b94b79f5ce17f5804f8d7308faf57bd3f0 (diff) |
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@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Diffstat (limited to 'src')
-rw-r--r-- | src/amd/vulkan/radv_shader.c | 2 | ||||
-rw-r--r-- | src/compiler/nir/nir_opt_shrink_load.c (renamed from src/compiler/nir/nir_opt_shrink_load_constant.c) | 0 |
2 files changed, 2 insertions, 0 deletions
diff --git a/src/amd/vulkan/radv_shader.c b/src/amd/vulkan/radv_shader.c index af094e6220f..42f83bb3355 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 index f97b7f9b67f..f97b7f9b67f 100644 --- a/src/compiler/nir/nir_opt_shrink_load_constant.c +++ b/src/compiler/nir/nir_opt_shrink_load.c |