broadcom/compiler: flag use of control barriers
authorIago Toral Quiroga <itoral@igalia.com>
Thu, 25 May 2023 06:45:40 +0000 (08:45 +0200)
committerIago Toral Quiroga <itoral@igalia.com>
Thu, 25 May 2023 12:28:30 +0000 (14:28 +0200)
commite99ab86f77730a7f90a9eccfc51565b6027e5f95
tree8b7d406b7fd75b0377cf51953c5ee1a1b1a7b7d5
parentb6e40edae6f1eee70924902e564fcd116500763d
broadcom/compiler: flag use of control barriers

We have been relying on NIR's gather info pass for this
but it is not safe unless we are certain we are always
calling it after any other pass that may emit a control
barrier.

As it stands, nir_zero_initialize_shared_memory can emit a
control barrier and we don't call the gather info pass after
it, which is problematic. The only reason this is not really
a problem right now is because for non-scoped barriers (which
is what we currently use) it doesn't emit a scoped barrier, just
a regular memory barrier (which is probably a bug in the pass!),
but as soon as we move to scoped barriers, this is going
to be a problem, since we need to know when we emit a control
barrier to ensure supergroup calculations prevent deadlocks at
the barrier op.

Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Alejandro PiƱeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23228>
src/broadcom/compiler/nir_to_vir.c