aco/scheduler: fix register demand check

Fixes deathloop/01f8d58bf245663b with gfx1201.

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Fixes: 668259ef0b ("aco/scheduler: move clauses through RAR dependencies")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38402>
This commit is contained in:
Rhys Perry 2025-11-12 14:01:37 +00:00 committed by Marge Bot
parent 9141696d32
commit 6a5982cfe5

View file

@ -313,8 +313,9 @@ MoveState::downwards_move_clause(DownwardsCursor& cursor)
/* RegisterDemand changes caused by the instructions being moved over. */
RegisterDemand insert_diff = insert_demand - clause_end_demand + rar_dep;
/* Check the new demand of the instructions being moved over. */
if (RegisterDemand(cursor.total_demand - clause_diff).exceeds(max_registers))
/* Check the new demand of the instructions being moved over. If we somehow split total_demand
* into before and after rar_dep, we could make this more accurate. */
if (RegisterDemand(cursor.total_demand - clause_diff + rar_dep).exceeds(max_registers))
return move_fail_pressure;
/* Check max demand for the moved clause instructions. */