From 02bba6aab5df5282f22a15aacfec0ddd2240116c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timur=20Krist=C3=B3f?= Date: Thu, 5 Aug 2021 18:42:17 +0200 Subject: [PATCH] ac/nir/nggc: Don't stop applying reusable variables at prim export. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This was a mistake that prevented reusing variables in shaders with late primitive export. Fossil DB stats on Sienna Cichlid with NGGC on: Totals from 6547 (5.09% of 128647) affected shaders: VGPRs: 323368 -> 323824 (+0.14%); split: -0.03%, +0.18% SpillSGPRs: 45 -> 4865 (+10711.11%) CodeSize: 34208732 -> 33855952 (-1.03%); split: -1.21%, +0.18% MaxWaves: 142538 -> 142456 (-0.06%); split: +0.04%, -0.09% Instrs: 6654252 -> 6606432 (-0.72%); split: -0.89%, +0.17% Latency: 30527770 -> 30452769 (-0.25%); split: -0.42%, +0.18% InvThroughput: 5604540 -> 5609450 (+0.09%); split: -0.04%, +0.13% VClause: 121531 -> 120448 (-0.89%); split: -1.17%, +0.27% SClause: 195388 -> 177902 (-8.95%); split: -9.14%, +0.19% Copies: 617949 -> 636397 (+2.99%); split: -0.44%, +3.42% Branches: 228184 -> 228281 (+0.04%); split: -0.09%, +0.13% PreSGPRs: 271395 -> 343555 (+26.59%); split: -0.01%, +26.60% PreVGPRs: 277650 -> 277710 (+0.02%); split: -0.01%, +0.03% Signed-off-by: Timur Kristóf Reviewed-by: Daniel Schürmann Part-of: --- src/amd/common/ac_nir_lower_ngg.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/amd/common/ac_nir_lower_ngg.c b/src/amd/common/ac_nir_lower_ngg.c index ae56754709f..c3b525477ff 100644 --- a/src/amd/common/ac_nir_lower_ngg.c +++ b/src/amd/common/ac_nir_lower_ngg.c @@ -840,8 +840,7 @@ apply_reusable_variables(nir_builder *b, lower_ngg_nogs_state *nogs_state) /* When we found any of these intrinsics, it means * we reached the top part and we must stop. */ - if (intrin->intrinsic == nir_intrinsic_alloc_vertices_and_primitives_amd || - intrin->intrinsic == nir_intrinsic_export_primitive_amd) + if (intrin->intrinsic == nir_intrinsic_alloc_vertices_and_primitives_amd) goto done; if (intrin->intrinsic != nir_intrinsic_store_deref)