gallivm: fix atomic global temporary storage.
authorDave Airlie <airlied@gmail.com>
Fri, 21 Jul 2023 01:35:36 +0000 (11:35 +1000)
committerMarge Bot <emma+marge@anholt.net>
Fri, 21 Jul 2023 20:48:16 +0000 (20:48 +0000)
Fixes regression on llvm15 with
piglit tests/cl/program/execute/builtin/atomic/atomic_xchg-global.cl

Fixes: f28129000511 ("gallivm: Fix atomic_global types")
Reviewed-by: Konstantin Seurer <konstantin.seurer@gmail.com>
Tested-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24267>

src/gallium/auxiliary/gallivm/lp_bld_nir_soa.c

index b725939..9ad504c 100644 (file)
@@ -1111,7 +1111,7 @@ static void emit_atomic_global(struct lp_build_nir_context *bld_base,
       val = LLVMBuildBitCast(builder, val, atom_bld->vec_type, "");
 
    LLVMValueRef atom_res = lp_build_alloca(gallivm,
-                                           LLVMTypeOf(val), "");
+                                           atom_bld->vec_type, "");
    LLVMValueRef exec_mask = mask_vec(bld_base);
    struct lp_build_loop_state loop_state;
    lp_build_loop_begin(&loop_state, gallivm, lp_build_const_int32(gallivm, 0));