radeonsi: work around an LLVM crash when using llvm.amdgcn.icmp.i64.i1
authorMarek Olšák <marek.olsak@amd.com>
Thu, 9 Jan 2020 02:52:26 +0000 (21:52 -0500)
committerMarge Bot <eric+marge@anholt.net>
Wed, 15 Jan 2020 20:17:23 +0000 (20:17 +0000)
Cc: 19.2 19.3 <mesa-stable@lists.freedesktop.org>
Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Tested-by: Marge Bot <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3338>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3338>

src/gallium/drivers/radeonsi/si_compute_prim_discard.c

index 4e691d088c2b566c85b69cff8ec536d2a7bf5d0e..2fcec436bb0bec066a43ec96be2402ed72b0f97f 100644 (file)
@@ -718,6 +718,7 @@ void si_build_prim_discard_compute_shader(struct si_shader_context *ctx)
                                 ac_get_arg(&ctx->ac, param_smallprim_precision),
                                 &options);
 
+       ac_build_optimization_barrier(&ctx->ac, &accepted);
        LLVMValueRef accepted_threadmask = ac_get_i1_sgpr_mask(&ctx->ac, accepted);
 
        /* Count the number of active threads by doing bitcount(accepted). */