From 52f8319dacfff03bab7997f4adfc88ddde8f60f1 Mon Sep 17 00:00:00 2001 From: Pierre-Eric Pelloux-Prayer Date: Mon, 10 Oct 2022 12:33:06 +0200 Subject: [PATCH] radeonsi: use LLVMBuildGEP2 in si_build_gep_i8_var MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Reviewed-by: Mihai Preda Reviewed-by: Dave Airlie Reviewed-by: Qiang Yu Reviewed-by: Marek Olšák Acked-by: Samuel Pitoiset Part-of: --- src/gallium/drivers/radeonsi/gfx10_shader_ngg.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/gallium/drivers/radeonsi/gfx10_shader_ngg.c b/src/gallium/drivers/radeonsi/gfx10_shader_ngg.c index 3fa5330352b..15d1543fb75 100644 --- a/src/gallium/drivers/radeonsi/gfx10_shader_ngg.c +++ b/src/gallium/drivers/radeonsi/gfx10_shader_ngg.c @@ -677,10 +677,12 @@ enum static LLVMValueRef si_build_gep_i8_var(struct si_shader_context *ctx, LLVMValueRef ptr, LLVMValueRef index) { +#if LLVM_VERSION_MAJOR < 14 LLVMTypeRef pi8 = LLVMPointerType(ctx->ac.i8, AC_ADDR_SPACE_LDS); + ptr = LLVMBuildPointerCast(ctx->ac.builder, ptr, pi8, ""); +#endif - return LLVMBuildGEP(ctx->ac.builder, LLVMBuildPointerCast(ctx->ac.builder, ptr, pi8, ""), &index, - 1, ""); + return LLVMBuildGEP2(ctx->ac.builder, ctx->ac.i8, ptr, &index, 1, ""); } static LLVMValueRef si_build_gep_i8(struct si_shader_context *ctx, LLVMValueRef ptr,