aco/post-ra: track pseudo scratch sgpr/scc clobber

Foz-DB Navi31:
Totals from 1439 (1.84% of 78112) affected shaders:
Instrs: 1994854 -> 1996650 (+0.09%)
CodeSize: 11376864 -> 11383384 (+0.06%)
Latency: 14996299 -> 14999317 (+0.02%); split: -0.00%, +0.02%
InvThroughput: 2061294 -> 2061518 (+0.01%); split: -0.00%, +0.01%

Cc: mesa-stable

Reviewed-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/27855>
(cherry picked from commit e7d6cd9216)
This commit is contained in:
Georg Lehmann 2024-02-28 17:44:39 +01:00 committed by Eric Engestrom
parent 1885c9f4a9
commit e93dbb6df2
2 changed files with 7 additions and 1 deletions

View file

@ -964,7 +964,7 @@
"description": "aco/post-ra: track pseudo scratch sgpr/scc clobber",
"nominated": true,
"nomination_type": 0,
"resolution": 0,
"resolution": 1,
"main_sha": null,
"because_sha": null,
"notes": null

View file

@ -157,6 +157,12 @@ save_reg_writes(pr_opt_ctx& ctx, aco_ptr<Instruction>& instr)
std::fill(ctx.instr_idx_by_regs[ctx.current_block->index].begin() + r,
ctx.instr_idx_by_regs[ctx.current_block->index].begin() + r + dw_size, idx);
}
if (instr->isPseudo() && instr->pseudo().needs_scratch_reg) {
if (!instr->pseudo().tmp_in_scc)
ctx.instr_idx_by_regs[ctx.current_block->index][scc] = overwritten_unknown_instr;
ctx.instr_idx_by_regs[ctx.current_block->index][instr->pseudo().scratch_sgpr] =
overwritten_unknown_instr;
}
}
Idx