aco/ra: add first loop header phi operand to temp_to_phi_resources

If the first operand is a CSSA copy, we might want to add this to
temp_to_phi_resources, so that we later mark it as the last-seen phi
operand.

fossil-db (navi31):
Totals from 284 (0.36% of 79825) affected shaders:
Instrs: 4160233 -> 4157517 (-0.07%); split: -0.09%, +0.03%
CodeSize: 21546420 -> 21532884 (-0.06%); split: -0.09%, +0.02%
VGPRs: 31404 -> 31416 (+0.04%)
Latency: 40266308 -> 40253731 (-0.03%); split: -0.06%, +0.02%
InvThroughput: 8140751 -> 8139724 (-0.01%); split: -0.05%, +0.04%
VClause: 99849 -> 99835 (-0.01%); split: -0.02%, +0.01%
Copies: 344512 -> 341732 (-0.81%); split: -1.08%, +0.28%
Branches: 113620 -> 113629 (+0.01%); split: -0.02%, +0.03%
VALU: 2502619 -> 2499836 (-0.11%); split: -0.15%, +0.04%
SALU: 499245 -> 499341 (+0.02%); split: -0.02%, +0.04%

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Reviewed-by: Emre Cecanpunar <emreleno@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38695>
This commit is contained in:
Rhys Perry
2025-11-26 15:43:11 +00:00
committed by Marge Bot
parent 43b3901362
commit 21414e0898

View File

@@ -3212,7 +3212,7 @@ get_affinities(ra_ctx& ctx)
affinity_related->emplace_back(op.getTemp());
if (ctx.assignments[def.id()].precolor_affinity)
ctx.assignments[op.tempId()].set_precolor_affinity(ctx.assignments[def.id()].reg);
if (block.kind & block_kind_loop_header)
if (block.kind & block_kind_loop_header && &op != &instr->operands[0])
continue;
temp_to_phi_resources[op.tempId()] = index;
}