From 51cf04cf0e4b348de7e920deff1dad3fb4e62407 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Marek=20Ol=C5=A1=C3=A1k?= Date: Tue, 17 May 2016 23:10:24 +0200 Subject: [PATCH] radeonsi: add a workaround for a bug in LLVM <= 3.8 MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit This is not directly applicable to stable and needs to be backported. Reviewed-by: Nicolai Hähnle --- src/gallium/drivers/radeonsi/si_shader.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/gallium/drivers/radeonsi/si_shader.c b/src/gallium/drivers/radeonsi/si_shader.c index 6166403f549..3df78200ff3 100644 --- a/src/gallium/drivers/radeonsi/si_shader.c +++ b/src/gallium/drivers/radeonsi/si_shader.c @@ -556,6 +556,13 @@ static LLVMValueRef get_bounded_indirect_index(struct si_shader_context *ctx, LLVMValueRef c_max = LLVMConstInt(ctx->i32, num - 1, 0); LLVMValueRef cc; + /* LLVM 3.8: If indirect resource indexing is used: + * - SI & CIK hang + * - VI crashes + */ + if (HAVE_LLVM <= 0x0308) + return LLVMGetUndef(ctx->i32); + if (util_is_power_of_two(num)) { result = LLVMBuildAnd(builder, result, c_max, ""); } else { -- 2.30.2