From ea514e9385eaf55cbc240753d99db56dbf00ab76 Mon Sep 17 00:00:00 2001 From: Georg Lehmann Date: Sun, 19 Jan 2025 12:03:02 +0100 Subject: [PATCH] aco/sched_ilp: continue open clauses MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Foz-DB GFX1150: Totals from 13789 (17.37% of 79395) affected shaders: Instrs: 16567395 -> 16570832 (+0.02%); split: -0.03%, +0.05% CodeSize: 85737492 -> 85751072 (+0.02%); split: -0.02%, +0.04% Latency: 140988872 -> 140831767 (-0.11%); split: -0.12%, +0.01% InvThroughput: 29639206 -> 29614890 (-0.08%); split: -0.09%, +0.00% VClause: 347065 -> 343779 (-0.95%); split: -0.96%, +0.01% SClause: 424881 -> 418657 (-1.46%); split: -1.48%, +0.02% Reviewed-by: Daniel Schürmann Reviewed-by: Daniel Schürmann Part-of: --- src/amd/compiler/aco_scheduler_ilp.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/amd/compiler/aco_scheduler_ilp.cpp b/src/amd/compiler/aco_scheduler_ilp.cpp index 7855cb66c0e..d85c8cde7d3 100644 --- a/src/amd/compiler/aco_scheduler_ilp.cpp +++ b/src/amd/compiler/aco_scheduler_ilp.cpp @@ -543,11 +543,16 @@ select_instruction_ilp(const SchedILPContext& ctx) { mask_t mask = ctx.active_mask; - /* First, collect all dependencies of the next non-reorderable instruction(s). + /* First, continue the currently open clause. + * Otherwise collect all dependencies of the next non-reorderable instruction(s). * These make up the list of possible candidates. */ - if (ctx.next_non_reorderable != UINT8_MAX) + if (ctx.next_non_reorderable != UINT8_MAX) { + if (ctx.prev_info.instr && ctx.nodes[ctx.next_non_reorderable].dependency_mask == 0 && + should_form_clause(ctx.prev_info.instr, ctx.nodes[ctx.next_non_reorderable].instr)) + return ctx.next_non_reorderable; mask = collect_clause_dependencies(ctx, ctx.next_non_reorderable, 0); + } /* If the next non-reorderable instruction has no dependencies, select it */ if (mask == 0)