radeonsi: set the convergent attribute where needed
authorMarek Olšák <marek.olsak@amd.com>
Sun, 26 Feb 2017 18:00:44 +0000 (19:00 +0100)
committerMarek Olšák <marek.olsak@amd.com>
Mon, 6 Mar 2017 13:13:04 +0000 (14:13 +0100)
Reviewed-by: Dave Airlie <airlied@redhat.com>
src/amd/common/ac_llvm_build.c
src/gallium/drivers/radeonsi/si_shader.c

index 20c6eb80560e9605e336c3d0f9e8986960869862..0039e63e840217675b3af9f833b8d304a9046a11 100644 (file)
@@ -861,13 +861,17 @@ ac_build_ddxy(struct ac_llvm_context *ctx,
                args[1] = val;
                tl = ac_build_intrinsic(ctx,
                                        "llvm.amdgcn.ds.bpermute", ctx->i32,
-                                       args, 2, AC_FUNC_ATTR_READNONE);
+                                       args, 2,
+                                       AC_FUNC_ATTR_READNONE |
+                                       AC_FUNC_ATTR_CONVERGENT);
 
                args[0] = LLVMBuildMul(ctx->builder, trbl_tid,
                                       LLVMConstInt(ctx->i32, 4, false), "");
                trbl = ac_build_intrinsic(ctx,
                                          "llvm.amdgcn.ds.bpermute", ctx->i32,
-                                         args, 2, AC_FUNC_ATTR_READNONE);
+                                         args, 2,
+                                         AC_FUNC_ATTR_READNONE |
+                                         AC_FUNC_ATTR_CONVERGENT);
        } else {
                LLVMValueRef store_ptr, load_ptr0, load_ptr1;
 
index 4e133ecebf68eed9a25b84adb75599bead8fdaf3..edfa28485351581c8a5935e867386859712af0ad 100644 (file)
@@ -5207,7 +5207,7 @@ static void si_llvm_emit_barrier(const struct lp_build_tgsi_action *action,
        lp_build_intrinsic(gallivm->builder,
                           HAVE_LLVM >= 0x0309 ? "llvm.amdgcn.s.barrier"
                                               : "llvm.AMDGPU.barrier.local",
-                          ctx->voidt, NULL, 0, 0);
+                          ctx->voidt, NULL, 0, LP_FUNC_ATTR_CONVERGENT);
 }
 
 static const struct lp_build_tgsi_action tex_action = {