From 9fe3af1e2a22e25299fdb2a00a7490dfda8ab370 Mon Sep 17 00:00:00 2001 From: Rhys Perry Date: Fri, 25 Aug 2023 13:56:55 +0100 Subject: [PATCH] aco: insert s_nop before discard early exit sendmsg(dealloc_vgpr) Forgot about this one. fossil-db (gfx1100): Totals from 3920 (2.94% of 133461) affected shaders: Instrs: 6632088 -> 6636008 (+0.06%) CodeSize: 34165376 -> 34181056 (+0.05%) Signed-off-by: Rhys Perry Reviewed-by: Georg Lehmann Fixes: 37fbfa655a4d ("aco: insert s_nop before VGPR deallocation") Part-of: --- src/amd/compiler/aco_lower_to_hw_instr.cpp | 4 +++- src/amd/compiler/tests/test_isel.cpp | 2 ++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/amd/compiler/aco_lower_to_hw_instr.cpp b/src/amd/compiler/aco_lower_to_hw_instr.cpp index 9df0b79544c..582028a56b5 100644 --- a/src/amd/compiler/aco_lower_to_hw_instr.cpp +++ b/src/amd/compiler/aco_lower_to_hw_instr.cpp @@ -2375,8 +2375,10 @@ lower_to_hw_instr(Program* program) if (program->stage == fragment_fs) bld.exp(aco_opcode::exp, Operand(v1), Operand(v1), Operand(v1), Operand(v1), 0, target, false, true, true); - if (should_dealloc_vgprs) + if (should_dealloc_vgprs) { + bld.sopp(aco_opcode::s_nop, 0); bld.sopp(aco_opcode::s_sendmsg, sendmsg_dealloc_vgprs); + } bld.sopp(aco_opcode::s_endpgm); bld.reset(&ctx.instructions); diff --git a/src/amd/compiler/tests/test_isel.cpp b/src/amd/compiler/tests/test_isel.cpp index 0b34dc65a68..2c45871e18d 100644 --- a/src/amd/compiler/tests/test_isel.cpp +++ b/src/amd/compiler/tests/test_isel.cpp @@ -177,6 +177,7 @@ BEGIN_TEST(isel.discard_early_exit.mrtz) //! s_endpgm ; $_ //! BB1: //! exp mrtz off, off, off, off done ; $_ $_ + //! s_nop 0 ; $_ //! s_sendmsg sendmsg(MSG_DEALLOC_VGPRS) ; $_ //! s_endpgm ; $_ @@ -205,6 +206,7 @@ BEGIN_TEST(isel.discard_early_exit.mrt0) //! s_endpgm ; $_ //! BB1: //! exp mrt0 off, off, off, off done ; $_ $_ + //! s_nop 0 ; $_ //! s_sendmsg sendmsg(MSG_DEALLOC_VGPRS) ; $_ //! s_endpgm ; $_