aco/gfx12: fix VALUReadSGPRHazard with carry-out

fossil-db (gfx1201):
Totals from 370 (0.46% of 79653) affected shaders:
Instrs: 3933639 -> 3935914 (+0.06%)
CodeSize: 20743448 -> 20752068 (+0.04%); split: -0.00%, +0.04%
Latency: 26261246 -> 26261921 (+0.00%); split: -0.00%, +0.00%
InvThroughput: 5363675 -> 5363760 (+0.00%); split: -0.00%, +0.00%

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Fixes: 65f95ae74e ("aco/insert_NOPs: implement VALU -> VALU case for VALUReadSGPRHazard on GFX12")
Reviewed-by: Georg Lehmann <dadschoorse@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35387>
(cherry picked from commit a714a19e16)
This commit is contained in:
Rhys Perry 2025-06-06 17:45:48 +01:00 committed by Eric Engestrom
parent 85af264acc
commit b03ee0a308
2 changed files with 3 additions and 3 deletions

View file

@ -5044,7 +5044,7 @@
"description": "aco/gfx12: fix VALUReadSGPRHazard with carry-out",
"nominated": true,
"nomination_type": 2,
"resolution": 0,
"resolution": 1,
"main_sha": null,
"because_sha": "65f95ae74e9c0e30bd14bfca347caeedce486bba",
"notes": null

View file

@ -1618,9 +1618,9 @@ handle_instruction_gfx11(State& state, NOP_ctx_gfx11& ctx, aco_ptr<Instruction>&
}
if (instr->isVALU() && !instr->definitions.empty()) {
PhysReg reg = instr->definitions[0].physReg();
PhysReg reg = instr->definitions.back().physReg();
if (reg < m0 && ctx.sgpr_read_by_valu[reg / 2]) {
for (unsigned i = 0; i < instr->definitions[0].size(); i++)
for (unsigned i = 0; i < instr->definitions.back().size(); i++)
ctx.sgpr_read_by_valu_then_wr_by_valu.set(reg + i);
}
} else if (instr->isSALU() && !instr->definitions.empty()) {