From b2e59d80b05d12cdd7b4aee4cf9292bff6a9f59a Mon Sep 17 00:00:00 2001 From: Georg Lehmann Date: Tue, 14 Apr 2026 15:53:25 +0200 Subject: [PATCH] radv: do not shrink vectors when lowering IO vars to scalar MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit I wanted to move this later, but looking at the stats, this pass actually hurts here because it shrinks smem loads that would be better vectorized. So just remove it. Foz-DB Navi48: Totals from 2268 (1.11% of 205045) affected shaders: Instrs: 1573491 -> 1569535 (-0.25%); split: -0.35%, +0.10% CodeSize: 8399092 -> 8378632 (-0.24%); split: -0.39%, +0.14% SpillSGPRs: 312 -> 355 (+13.78%) Latency: 12223349 -> 12225239 (+0.02%); split: -0.20%, +0.21% InvThroughput: 2235646 -> 2236174 (+0.02%); split: -0.15%, +0.17% VClause: 26526 -> 26549 (+0.09%); split: -0.02%, +0.11% SClause: 34974 -> 34053 (-2.63%); split: -3.01%, +0.37% Copies: 114417 -> 115513 (+0.96%); split: -0.33%, +1.28% Branches: 28085 -> 26899 (-4.22%); split: -4.24%, +0.02% PreSGPRs: 98109 -> 99024 (+0.93%); split: -0.10%, +1.03% PreVGPRs: 78224 -> 78226 (+0.00%) VALU: 929067 -> 928588 (-0.05%); split: -0.08%, +0.03% SALU: 204756 -> 206936 (+1.06%); split: -0.19%, +1.26% SMEM: 67181 -> 64687 (-3.71%); split: -3.83%, +0.11% Reviewed-by: Marek Olšák Reviewed-by: Samuel Pitoiset Acked-by: Daniel Schürmann Part-of: --- src/amd/vulkan/nir/radv_nir_lower_io.c | 5 ----- 1 file changed, 5 deletions(-) diff --git a/src/amd/vulkan/nir/radv_nir_lower_io.c b/src/amd/vulkan/nir/radv_nir_lower_io.c index e4d6bfcf6e7..1f5f338f622 100644 --- a/src/amd/vulkan/nir/radv_nir_lower_io.c +++ b/src/amd/vulkan/nir/radv_nir_lower_io.c @@ -27,11 +27,6 @@ radv_nir_lower_io_vars_to_scalar(nir_shader *nir, nir_variable_mode mask) bool progress = false; NIR_PASS(progress, nir, nir_lower_io_vars_to_scalar, mask); - if (progress) { - /* Optimize the new vector code and then remove dead vars */ - NIR_PASS(_, nir, nir_opt_copy_prop); - NIR_PASS(_, nir, nir_opt_shrink_vectors, true); - } } typedef struct {