ac/llvm: Fix validation error with global io

Fixes: afd645f057 ("ac/llvm: remove LLVMBuildGEP usages")
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20521>
This commit is contained in:
Konstantin Seurer 2023-01-04 16:49:08 +01:00 committed by Marge Bot
parent 55175cd13c
commit 10ac51a52b

View file

@ -2144,7 +2144,7 @@ static LLVMValueRef get_global_address(struct ac_nir_context *ctx,
LLVMTypeRef i8_ptr_type = LLVMPointerType(ctx->ac.i8, AC_ADDR_SPACE_GLOBAL); LLVMTypeRef i8_ptr_type = LLVMPointerType(ctx->ac.i8, AC_ADDR_SPACE_GLOBAL);
addr = LLVMBuildIntToPtr(ctx->ac.builder, addr, i8_ptr_type, ""); addr = LLVMBuildIntToPtr(ctx->ac.builder, addr, i8_ptr_type, "");
addr = LLVMBuildGEP2(ctx->ac.builder, ctx->ac.i8, addr, &offset, 1, ""); addr = LLVMBuildGEP2(ctx->ac.builder, ctx->ac.i8, addr, &offset, 1, "");
return addr; return LLVMBuildPointerCast(ctx->ac.builder, addr, ptr_type, "");
} else { } else {
return LLVMBuildIntToPtr(ctx->ac.builder, addr, ptr_type, ""); return LLVMBuildIntToPtr(ctx->ac.builder, addr, ptr_type, "");
} }