From 9775318aa94a101a088a7cfdda91a8af098aced1 Mon Sep 17 00:00:00 2001 From: Rhys Perry Date: Mon, 8 Apr 2024 15:20:48 +0100 Subject: [PATCH] aco: don't include the clause in VMEM_CLAUSE_MAX_GRAB_DIST MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit By excluding the clause from this check, we only count the number of instructions that we're actually moving the store across. fossil-db (navi31): Totals from 4409 (5.55% of 79395) affected shaders: MaxWaves: 120234 -> 119738 (-0.41%) Instrs: 3184513 -> 3184702 (+0.01%); split: -0.09%, +0.09% CodeSize: 15942424 -> 15943276 (+0.01%); split: -0.07%, +0.07% VGPRs: 248448 -> 255816 (+2.97%); split: -0.04%, +3.00% Latency: 18841156 -> 18829451 (-0.06%); split: -0.08%, +0.02% InvThroughput: 2549229 -> 2552042 (+0.11%); split: -0.02%, +0.13% VClause: 67760 -> 64138 (-5.35%); split: -5.40%, +0.06% SClause: 82921 -> 82922 (+0.00%) Copies: 270026 -> 273399 (+1.25%); split: -0.14%, +1.39% VALU: 1793374 -> 1796743 (+0.19%); split: -0.02%, +0.21% VOPD: 798 -> 802 (+0.50%); split: +0.63%, -0.13% Signed-off-by: Rhys Perry Reviewed-by: Daniel Schürmann Part-of: --- src/amd/compiler/aco_scheduler.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/amd/compiler/aco_scheduler.cpp b/src/amd/compiler/aco_scheduler.cpp index 69845cc5a9b..20a08ac7636 100644 --- a/src/amd/compiler/aco_scheduler.cpp +++ b/src/amd/compiler/aco_scheduler.cpp @@ -1033,9 +1033,9 @@ schedule_VMEM_store(sched_ctx& ctx, Block* block, std::vector& r init_hazard_query(ctx, &hq); DownwardsCursor cursor = ctx.mv.downwards_init(idx, true, true); - unsigned skip = 0; + int skip = 0; - for (int i = 0; i < VMEM_CLAUSE_MAX_GRAB_DIST; i++) { + for (int i = 0; (i - skip) < VMEM_CLAUSE_MAX_GRAB_DIST; i++) { aco_ptr& candidate = block->instructions[cursor.source_idx]; if (candidate->opcode == aco_opcode::p_logical_start) break;