radv: Run nir_opt_deref after first optimization loop

Only at this point are loads from uninitialized variables lowered to
undef and copy-propagated so that nir_opt_deref's cast-of-undef
optimization works properly.

Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40799>
This commit is contained in:
Natalie Vock 2026-04-14 13:20:36 +02:00 committed by Marge Bot
parent 57f796752d
commit 1f998b38f4

View file

@ -785,6 +785,7 @@ radv_shader_spirv_to_nir(struct radv_device *device, struct radv_shader_stage *s
radv_optimize_nir(nir, false);
NIR_PASS(_, nir, nir_opt_memcpy);
NIR_PASS(_, nir, nir_opt_deref);
}
/* We call nir_lower_var_copies() after the first radv_optimize_nir()