From dea444f80f9bbb269cd8a9238db69a574f49d129 Mon Sep 17 00:00:00 2001 From: Georg Lehmann Date: Wed, 27 May 2026 09:22:43 +0200 Subject: [PATCH] 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: bb311ce370d ("nir: Allow atomics as non-complex uses for var-splitting passes") Reviewed-by: Rhys Perry Part-of: --- src/compiler/nir/nir_deref.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/compiler/nir/nir_deref.c b/src/compiler/nir/nir_deref.c index 860a0f84822..1cfea51c9c9 100644 --- a/src/compiler/nir/nir_deref.c +++ b/src/compiler/nir/nir_deref.c @@ -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;