ac/nir: only use the new raw/struct SSBO atomic intrinsics with LLVM 9+
authorSamuel Pitoiset <samuel.pitoiset@gmail.com>
Thu, 18 Apr 2019 07:06:49 +0000 (09:06 +0200)
committerSamuel Pitoiset <samuel.pitoiset@gmail.com>
Fri, 19 Apr 2019 07:20:13 +0000 (09:20 +0200)
They are buggy with older LLVM version, see r358579.

Fixes: 78c551aca1c ("ac/nir: use new LLVM 8 intrinsics for SSBO atomics except cmpswap")
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
src/amd/common/ac_nir_to_llvm.c

index fcd75903088d7596ed52bf68c8945e9811fde0f5..30e5cc8c38979ec577cc747ca6cba5e74c17d50d 100644 (file)
@@ -1692,8 +1692,11 @@ static LLVMValueRef visit_atomic_ssbo(struct ac_nir_context *ctx,
                                                  get_src(ctx, instr->src[0]),
                                                  true);
 
-       if (HAVE_LLVM >= 0x800 &&
+       if (HAVE_LLVM >= 0x900 &&
            instr->intrinsic != nir_intrinsic_ssbo_atomic_comp_swap) {
+               /* XXX: The new raw/struct atomic intrinsics are buggy with
+                * LLVM 8, see r358579.
+                */
                params[arg_count++] = get_src(ctx, instr->src[1]); /* voffset */
                params[arg_count++] = ctx->ac.i32_0; /* soffset */
                params[arg_count++] = ctx->ac.i32_0; /* slc */