mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-07 11:28:05 +02:00
aco: fix detecting sgprs read by SMEM hazard
s_waitcnt_lgkmcnt is SOPK, not SOPP and there are other SOPK instructions that don't mitigate the hazard. Reviewed-by: Rhys Perry <pendingchaos02@gmail.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26163>
This commit is contained in:
parent
e49c413a86
commit
2f4e53b22a
1 changed files with 10 additions and 12 deletions
|
|
@ -1026,20 +1026,18 @@ handle_instruction_gfx10(State& state, NOP_ctx_gfx10& ctx, aco_ptr<Instruction>&
|
||||||
bld.sop1(aco_opcode::s_mov_b32, Definition(sgpr_null, s1), Operand::zero());
|
bld.sop1(aco_opcode::s_mov_b32, Definition(sgpr_null, s1), Operand::zero());
|
||||||
}
|
}
|
||||||
} else if (instr->isSALU()) {
|
} else if (instr->isSALU()) {
|
||||||
if (instr->format != Format::SOPP) {
|
|
||||||
/* SALU can mitigate the hazard */
|
|
||||||
ctx.sgprs_read_by_SMEM.reset();
|
|
||||||
} else {
|
|
||||||
/* Reducing lgkmcnt count to 0 always mitigates the hazard. */
|
/* Reducing lgkmcnt count to 0 always mitigates the hazard. */
|
||||||
const SOPP_instruction& sopp = instr->sopp();
|
if (instr->opcode == aco_opcode::s_waitcnt_lgkmcnt) {
|
||||||
if (sopp.opcode == aco_opcode::s_waitcnt_lgkmcnt) {
|
const SOPK_instruction& sopk = instr->sopk();
|
||||||
if (sopp.imm == 0 && sopp.operands[0].physReg() == sgpr_null)
|
if (sopk.imm == 0 && sopk.operands[0].physReg() == sgpr_null)
|
||||||
ctx.sgprs_read_by_SMEM.reset();
|
ctx.sgprs_read_by_SMEM.reset();
|
||||||
} else if (sopp.opcode == aco_opcode::s_waitcnt) {
|
} else if (instr->opcode == aco_opcode::s_waitcnt) {
|
||||||
wait_imm imm(state.program->gfx_level, instr->sopp().imm);
|
wait_imm imm(state.program->gfx_level, instr->sopp().imm);
|
||||||
if (imm.lgkm == 0)
|
if (imm.lgkm == 0)
|
||||||
ctx.sgprs_read_by_SMEM.reset();
|
ctx.sgprs_read_by_SMEM.reset();
|
||||||
}
|
} else if (instr->format != Format::SOPP && instr->definitions.size()) {
|
||||||
|
/* SALU can mitigate the hazard */
|
||||||
|
ctx.sgprs_read_by_SMEM.reset();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue