From 37fbfa655a4dd73a1c95ade29362d8e93f5d1fcc Mon Sep 17 00:00:00 2001 From: Rhys Perry Date: Tue, 25 Jul 2023 17:51:24 +0100 Subject: [PATCH] aco: insert s_nop before VGPR deallocation MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit A hazard requires this, apparently. https://reviews.llvm.org/D155681 fossil-db (gfx1100): Totals from 23175 (17.36% of 133461) affected shaders: Instrs: 41240100 -> 41263275 (+0.06%) CodeSize: 211858524 -> 211951224 (+0.04%) Latency: 469738570 -> 469738576 (+0.00%) InvThroughput: 58013998 -> 58013999 (+0.00%) Signed-off-by: Rhys Perry Reviewed-by: Daniel Schürmann Cc: mesa-stable Part-of: --- src/amd/compiler/aco_ir.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/amd/compiler/aco_ir.cpp b/src/amd/compiler/aco_ir.cpp index 179d282..ecf34ed 100644 --- a/src/amd/compiler/aco_ir.cpp +++ b/src/amd/compiler/aco_ir.cpp @@ -1351,6 +1351,8 @@ dealloc_vgprs(Program* program) Builder bld(program); if (!block.instructions.empty() && block.instructions.back()->opcode == aco_opcode::s_endpgm) { bld.reset(&block.instructions, block.instructions.begin() + (block.instructions.size() - 1)); + /* Due to a hazard, an s_nop is needed before "s_sendmsg sendmsg_dealloc_vgprs". */ + bld.sopp(aco_opcode::s_nop, -1, 0); bld.sopp(aco_opcode::s_sendmsg, -1, sendmsg_dealloc_vgprs); } -- 2.7.4