ac/nir: only use the new raw/struct image atomic intrinsics with LLVM 9+
authorSamuel Pitoiset <samuel.pitoiset@gmail.com>
Thu, 18 Apr 2019 07:17:04 +0000 (09:17 +0200)
committerSamuel Pitoiset <samuel.pitoiset@gmail.com>
Fri, 19 Apr 2019 07:20:09 +0000 (09:20 +0200)
They are buggy with LLVM 8 because they weren't marked as source
of divergence, see r358579.

Fixes: dd0172e865f ("radv: Use structured intrinsics instead of indexing workaround for GFX9.")"
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 3890aebc982367eddbc1081d2ddb2086d927abb8..fcd75903088d7596ed52bf68c8945e9811fde0f5 100644 (file)
@@ -2634,7 +2634,10 @@ static LLVMValueRef visit_image_atomic(struct ac_nir_context *ctx,
                params[param_count++] = LLVMBuildExtractElement(ctx->ac.builder, get_src(ctx, instr->src[1]),
                                                                ctx->ac.i32_0, ""); /* vindex */
                params[param_count++] = ctx->ac.i32_0; /* voffset */
-               if (HAVE_LLVM >= 0x800) {
+               if (HAVE_LLVM >= 0x900) {
+                       /* XXX: The new raw/struct atomic intrinsics are buggy
+                        * with LLVM 8, see r358579.
+                        */
                        params[param_count++] = ctx->ac.i32_0; /* soffset */
                        params[param_count++] = ctx->ac.i32_0;  /* slc */