Without this, RA is confused and adds a bunch of unnecessary moves.
Fossil-db results (Navi 10):
Totals from 7658 (5.55% of 137887) affected shaders:
SGPRs: 752488 -> 752392 (-0.01%)
CodeSize:
74046720 ->
73924368 (-0.17%); split: -0.17%, +0.00%
Instrs:
14293916 ->
14263350 (-0.21%); split: -0.21%, +0.00%
Cycles:
1455556728 ->
1438466536 (-1.17%); split: -1.17%, +0.00%
VMEM:
1096736 ->
1094962 (-0.16%); split: +0.03%, -0.19%
SMEM: 448436 -> 448418 (-0.00%); split: +0.00%, -0.01%
SClause: 485501 -> 485495 (-0.00%); split: -0.00%, +0.00%
Copies:
1383769 ->
1353029 (-2.22%); split: -2.22%, +0.00%
Branches: 568247 -> 568451 (+0.04%); split: -0.01%, +0.05%
Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7677>
instr->opcode == aco_opcode::s_cselect_b32) &&
instr->operands[2].isTemp()) {
ctx.info[instr->operands[2].tempId()].set_scc_needed();
+ } else if (instr->opcode == aco_opcode::p_wqm &&
+ instr->operands[0].isTemp() &&
+ ctx.info[instr->definitions[0].tempId()].is_scc_needed()) {
+ /* Propagate label so it is correctly detected by the uniform bool transform */
+ ctx.info[instr->operands[0].tempId()].set_scc_needed();
+
+ /* Fix definition to SCC, this will prevent RA from adding superfluous moves */
+ instr->definitions[0].setFixed(scc);
}
/* check for literals */