aco: insert s_nop before VGPR deallocation

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>
(cherry picked from commit 37fbfa655a)
This commit is contained in:
Rhys Perry 2023-07-25 17:51:24 +01:00 committed by Dylan Baker
parent db57b09df2
commit 7f6d610bb7
2 changed files with 3 additions and 1 deletions

View file

@ -23554,7 +23554,7 @@
"description": "aco: insert s_nop before VGPR deallocation",
"nominated": true,
"nomination_type": 0,
"resolution": 0,
"resolution": 1,
"main_sha": null,
"because_sha": null,
"notes": null

View file

@ -1350,6 +1350,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);
}