broadcom/compiler: disallow tsy barrier in thrsw delay slots

A TSY barrier becomes effective at the point of the next thread switch,
so if we have one coming after a previous thread switch we need to
be careful not to emit it in its delay slots, or we would be effectively
moving the barrier earlier than intended.

Fixes simulator assert crash in:
dEQP-VK.graphicsfuzz.two-for-loops-with-barrier-function

Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13468>
This commit is contained in:
Iago Toral Quiroga 2021-10-21 12:06:16 +02:00
parent 9202e8cbaf
commit 75bd37dc6a

View file

@ -1648,6 +1648,14 @@ qpu_inst_after_thrsw_valid_in_delay_slot(struct v3d_compile *c,
if (v3d_qpu_writes_flags(&qinst->qpu))
return false;
/* TSY sync ops materialize at the point of the next thread switch,
* therefore, if we have a TSY sync right after a thread switch, we
* cannot place it in its delay slots, or we would be moving the sync
* to the thrsw before it instead.
*/
if (qinst->qpu.alu.add.op == V3D_QPU_A_BARRIERID)
return false;
return true;
}