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 ; $_