radeonsi: use LLVMBuildGEP2 in si_build_gep_i8_var

Reviewed-by: Mihai Preda <mhpreda@gmail.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Qiang Yu <yuq825@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Acked-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19035>
This commit is contained in:
Pierre-Eric Pelloux-Prayer
2022-10-10 12:33:06 +02:00
committed by Marge Bot
parent b58bb254f3
commit 52f8319dac
@@ -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,