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 <pendingchaos02@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24320>
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);
}