aco: don't emit early exit over dealloc_vgprs

fossil-db (navi31):
Totals from 3308 (4.17% of 79395) affected shaders:
Instrs: 387145 -> 375373 (-3.04%)
CodeSize: 2018276 -> 1964380 (-2.67%)
Latency: 6588004 -> 6549068 (-0.59%)
InvThroughput: 458792 -> 457025 (-0.39%); split: -0.39%, +0.00%
Branches: 10710 -> 7402 (-30.89%)

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Georg Lehmann <dadschoorse@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24884>
This commit is contained in:
Rhys Perry 2024-09-03 10:53:43 +01:00 committed by Marge Bot
parent 295b7d606f
commit 575f24d19f

View file

@ -2331,7 +2331,7 @@ lower_to_hw_instr(Program* program)
}
case aco_opcode::p_exit_early_if: {
/* don't bother with an early exit near the end of the program */
if ((block->instructions.size() - 1 - instr_idx) <= 4 &&
if ((block->instructions.size() - 1 - instr_idx) <= 5 &&
block->instructions.back()->opcode == aco_opcode::s_endpgm) {
unsigned null_exp_dest =
program->gfx_level >= GFX11 ? V_008DFC_SQ_EXP_MRT : V_008DFC_SQ_EXP_NULL;
@ -2350,6 +2350,9 @@ lower_to_hw_instr(Program* program)
instr2->definitions[0].isFixed() &&
instr2->definitions[0].physReg() == exec)
continue;
else if (instr2->opcode == aco_opcode::s_sendmsg &&
instr2->salu().imm == sendmsg_dealloc_vgprs)
continue;
ignore_early_exit = false;
}