From ad9c340d86b1cdd4c2b7bc9a2d4ba42d88df78cb Mon Sep 17 00:00:00 2001 From: Georg Lehmann Date: Wed, 23 Jul 2025 19:04:27 +0200 Subject: [PATCH] aco: insert VALU s_delay_alu for WMMA MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This should avoid some SIMD stalls. I think this special case was added to try to handle this case: First Instruction: WMMA Second Instruction: WMMA instruction with same VGPR of previous WMMA instruction’s Matrix D as Matrix C Stall if the first and second instruction are not the same type of WMMA or use ABS/NEG on SRC2 of the second instruction If I read it correctly, we shouldn't need a delay if the type is the same and no modifier is used. That's kind of complex to handle, so leave it for now. Not inserting any delays likely hurts more than this. Reviewed-by: Rhys Perry Part-of: --- src/amd/compiler/aco_insert_delay_alu.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/amd/compiler/aco_insert_delay_alu.cpp b/src/amd/compiler/aco_insert_delay_alu.cpp index 3b293c7df0a..1b5042839ba 100644 --- a/src/amd/compiler/aco_insert_delay_alu.cpp +++ b/src/amd/compiler/aco_insert_delay_alu.cpp @@ -256,8 +256,7 @@ gen_alu(Instruction* instr, delay_ctx& ctx) } } - update_alu(ctx, is_valu && instr_info.classes[(int)instr->opcode] != instr_class::wmma, is_trans, - cycle_info.issue_cycles); + update_alu(ctx, is_valu, is_trans, cycle_info.issue_cycles); } void