mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-03-02 12:50:33 +01:00
aco: fix pathological case in LdsDirectVALUHazard
Similar tobfd4ac4581. No fossil-db changes. Signed-off-by: Rhys Perry <pendingchaos02@gmail.com> Reviewed-by: Timur Kristóf <timur.kristof@gmail.com> Fixes:296b4d95a3("aco/gfx11: workaround LdsDirectVALUHazard") Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21423>
This commit is contained in:
parent
ee47cc8256
commit
94abccf3ce
1 changed files with 13 additions and 0 deletions
|
|
@ -1044,6 +1044,9 @@ struct LdsDirectVALUHazardGlobalState {
|
|||
struct LdsDirectVALUHazardBlockState {
|
||||
unsigned num_valu = 0;
|
||||
bool has_trans = false;
|
||||
|
||||
unsigned num_instrs = 0;
|
||||
unsigned num_blocks = 0;
|
||||
};
|
||||
|
||||
bool
|
||||
|
|
@ -1074,6 +1077,14 @@ handle_lds_direct_valu_hazard_instr(LdsDirectVALUHazardGlobalState& global_state
|
|||
if (parse_vdst_wait(instr) == 0)
|
||||
return true;
|
||||
|
||||
block_state.num_instrs++;
|
||||
if (block_state.num_instrs > 256 || block_state.num_blocks > 32) {
|
||||
/* Exit to limit compile times and set wait_vdst to be safe. */
|
||||
global_state.wait_vdst =
|
||||
MIN2(global_state.wait_vdst, block_state.has_trans ? 0 : block_state.num_valu);
|
||||
return true;
|
||||
}
|
||||
|
||||
return block_state.num_valu >= global_state.wait_vdst;
|
||||
}
|
||||
|
||||
|
|
@ -1087,6 +1098,8 @@ handle_lds_direct_valu_hazard_block(LdsDirectVALUHazardGlobalState& global_state
|
|||
global_state.loop_headers_visited.insert(block->index);
|
||||
}
|
||||
|
||||
block_state.num_blocks++;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue