Commit df940760 authored by Timur Kristóf's avatar Timur Kristóf Committed by Marge Bot
Browse files

aco/optimizer: Propagate scc_needed label through p_wqm.



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's avatarTimur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Daniel Schürmann's avatarDaniel Schürmann <daniel@schuermann.dev>
Part-of: <!7677>
parent 8bd3fefb
Pipeline #234984 waiting for manual action with stages
in 40 seconds
......@@ -3244,6 +3244,14 @@ void select_instruction(opt_ctx &ctx, aco_ptr<Instruction>& instr)
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 */
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment