[Mesa-dev] [PATCH] radeonsi: add a workaround for a bug in LLVM <= 3.8
Nicolai Hähnle
nhaehnle at gmail.com
Wed May 18 16:41:38 UTC 2016
On 18.05.2016 11:13, Marek Olšák wrote:
> From: Marek Olšák <marek.olsak at amd.com>
>
> This is not directly applicable to stable and needs to be backported.
This is because LLVM gets confused / misled about SGPRs vs. VGPRs,
right? It's unfortunate, but I see no better way, so...
Reviewed-by: Nicolai Hähnle <nicolai.haehnle at amd.com>
> ---
> 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 6166403..3df7820 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 {
>
More information about the mesa-dev
mailing list