From af4c6605a834f7c1f160fa4dbbcc119417659517 Mon Sep 17 00:00:00 2001 From: Rhys Perry Date: Tue, 25 Aug 2020 17:23:36 +0100 Subject: [PATCH] radv: use nir_opt_access MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit fossil-db (GFX10.3): Totals from 3231 (2.32% of 139391) affected shaders: SGPRs: 168654 -> 167454 (-0.71%); split: -0.72%, +0.00% VGPRs: 152352 -> 152416 (+0.04%) CodeSize: 13872836 -> 13806376 (-0.48%); split: -0.50%, +0.02% MaxWaves: 36640 -> 36634 (-0.02%) Instrs: 2639959 -> 2626852 (-0.50%); split: -0.52%, +0.03% Cycles: 77706000 -> 77496792 (-0.27%); split: -0.28%, +0.01% VMEM: 809496 -> 790847 (-2.30%); split: +2.06%, -4.36% SMEM: 267843 -> 253187 (-5.47%); split: +0.76%, -6.23% VClause: 61353 -> 60426 (-1.51%); split: -1.86%, +0.35% SClause: 95409 -> 92355 (-3.20%); split: -3.24%, +0.04% Copies: 194951 -> 196702 (+0.90%); split: -0.53%, +1.43% Branches: 84320 -> 84331 (+0.01%); split: -0.00%, +0.02% PreSGPRs: 110162 -> 110203 (+0.04%); split: -0.04%, +0.07% PreVGPRs: 127021 -> 127037 (+0.01%) Signed-off-by: Rhys Perry Reviewed-by: Daniel Schürmann Part-of: --- src/amd/vulkan/radv_shader.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/amd/vulkan/radv_shader.c b/src/amd/vulkan/radv_shader.c index 973e2a3..cfe6c6a 100644 --- a/src/amd/vulkan/radv_shader.c +++ b/src/amd/vulkan/radv_shader.c @@ -662,6 +662,12 @@ radv_shader_compile_to_nir(struct radv_device *device, */ nir_lower_var_copies(nir); + const nir_opt_access_options opt_access_options = { + .is_vulkan = true, + .infer_non_readable = true, + }; + NIR_PASS_V(nir, nir_opt_access, &opt_access_options); + NIR_PASS_V(nir, nir_lower_explicit_io, nir_var_mem_push_const, nir_address_format_32bit_offset); -- 2.7.4