nir/deref: consider atomics that store derefs as complex use

src[1] or src[2] would mean that the atomic uses the deref as data for the
op, we only want to allow address source uses.

Fixes: bb311ce370 ("nir: Allow atomics as non-complex uses for var-splitting passes")
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41818>
This commit is contained in:
Georg Lehmann 2026-05-27 09:22:43 +02:00 committed by Marge Bot
parent 6d0b1ebd3d
commit dea444f80f

View file

@ -230,7 +230,8 @@ nir_deref_instr_has_complex_use(nir_deref_instr *deref,
case nir_intrinsic_deref_atomic:
case nir_intrinsic_deref_atomic_swap:
if (opts & nir_deref_instr_has_complex_use_allow_atomics)
if (use_src == &use_intrin->src[0] &&
(opts & nir_deref_instr_has_complex_use_allow_atomics))
continue;
return true;