gallivm: fix a few llvm non-opaque pointers

As LLVM 15 transitions to opaque pointers, we need to update
the deprecated methods dealing with non-opaque pointers.

Reviewed-by: Brian Paul <brianp@vmware.com>
Acked-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17650>
This commit is contained in:
Mihai Preda 2022-06-30 09:14:02 +03:00 committed by Marge Bot
parent bdf91b25d9
commit b549394992
5 changed files with 18 additions and 11 deletions

View file

@ -206,7 +206,7 @@ LLVMValueRef lp_build_coro_alloc_mem_array(struct gallivm_state *gallivm,
LLVMValueRef coro_num_hdls)
{
LLVMTypeRef mem_ptr_type = LLVMPointerType(LLVMInt8TypeInContext(gallivm->context), 0);
LLVMValueRef alloced_ptr = LLVMBuildLoad(gallivm->builder, coro_hdl_ptr, "");
LLVMValueRef alloced_ptr = LLVMBuildLoad2(gallivm->builder, mem_ptr_type, coro_hdl_ptr, "");
LLVMValueRef not_alloced = LLVMBuildICmp(gallivm->builder, LLVMIntEQ, alloced_ptr, LLVMConstNull(mem_ptr_type), "");
LLVMValueRef coro_size = lp_build_coro_size(gallivm);

View file

@ -28,7 +28,10 @@
#include "lp_bld_format.h"
LLVMTypeRef lp_build_format_cache_member_data_type(struct gallivm_state *gallivm)
{
return LLVMArrayType(LLVMInt32TypeInContext(gallivm->context), LP_BUILD_FORMAT_CACHE_SIZE * 16);
}
LLVMTypeRef
lp_build_format_cache_type(struct gallivm_state *gallivm)
@ -36,9 +39,8 @@ lp_build_format_cache_type(struct gallivm_state *gallivm)
LLVMTypeRef elem_types[LP_BUILD_FORMAT_CACHE_MEMBER_COUNT];
LLVMTypeRef s;
elem_types[LP_BUILD_FORMAT_CACHE_MEMBER_DATA] =
LLVMArrayType(LLVMInt32TypeInContext(gallivm->context),
LP_BUILD_FORMAT_CACHE_SIZE * 16);
elem_types[LP_BUILD_FORMAT_CACHE_MEMBER_DATA] = lp_build_format_cache_member_data_type(gallivm);
elem_types[LP_BUILD_FORMAT_CACHE_MEMBER_TAGS] =
LLVMArrayType(LLVMInt64TypeInContext(gallivm->context),
LP_BUILD_FORMAT_CACHE_SIZE);

View file

@ -82,6 +82,8 @@ enum {
LLVMTypeRef
lp_build_format_cache_type(struct gallivm_state *gallivm);
LLVMTypeRef
lp_build_format_cache_member_data_type(struct gallivm_state *gallivm);
/*
* AoS

View file

@ -78,7 +78,8 @@ lp_build_fetch_rgba_aos_array(struct gallivm_state *gallivm,
* (If all callers can guarantee element type alignment, we should
* relax alignment restrictions elsewhere.)
*/
ptr = LLVMBuildGEP(builder, base_ptr, &offset, 1, "");
LLVMTypeRef byte_type = LLVMInt8TypeInContext(gallivm->context);
ptr = LLVMBuildGEP2(builder, byte_type, base_ptr, &offset, 1, "");
ptr = LLVMBuildPointerCast(builder, ptr, LLVMPointerType(src_vec_type, 0), "");
res = LLVMBuildLoad2(builder, src_vec_type, ptr, "");
LLVMSetAlignment(res, src_type.width / 8);

View file

@ -1134,14 +1134,15 @@ s3tc_store_cached_block(struct gallivm_state *gallivm,
indices[0] = lp_build_const_int32(gallivm, 0);
indices[1] = lp_build_const_int32(gallivm, LP_BUILD_FORMAT_CACHE_MEMBER_TAGS);
indices[2] = hash_index;
ptr = LLVMBuildGEP(builder, cache, indices, ARRAY_SIZE(indices), "");
LLVMTypeRef cache_type = lp_build_format_cache_type(gallivm);
ptr = LLVMBuildGEP2(builder, cache_type, cache, indices, ARRAY_SIZE(indices), "");
LLVMBuildStore(builder, tag_value, ptr);
indices[1] = lp_build_const_int32(gallivm, LP_BUILD_FORMAT_CACHE_MEMBER_DATA);
hash_index = LLVMBuildMul(builder, hash_index, lp_build_const_int32(gallivm, 16), "");
for (count = 0; count < 4; count++) {
indices[2] = hash_index;
ptr = LLVMBuildGEP(builder, cache, indices, ARRAY_SIZE(indices), "");
ptr = LLVMBuildGEP2(builder, cache_type, cache, indices, ARRAY_SIZE(indices), "");
ptr = LLVMBuildBitCast(builder, ptr, type_ptr4x32, "");
LLVMBuildStore(builder, col[count], ptr);
hash_index = LLVMBuildAdd(builder, hash_index, lp_build_const_int32(gallivm, 4), "");
@ -1150,7 +1151,7 @@ s3tc_store_cached_block(struct gallivm_state *gallivm,
static LLVMValueRef
s3tc_lookup_cached_pixel(struct gallivm_state *gallivm,
LLVMValueRef ptr,
LLVMValueRef cache,
LLVMValueRef index)
{
LLVMBuilderRef builder = gallivm->builder;
@ -1159,8 +1160,9 @@ s3tc_lookup_cached_pixel(struct gallivm_state *gallivm,
indices[0] = lp_build_const_int32(gallivm, 0);
indices[1] = lp_build_const_int32(gallivm, LP_BUILD_FORMAT_CACHE_MEMBER_DATA);
indices[2] = index;
member_ptr = LLVMBuildGEP(builder, ptr, indices, ARRAY_SIZE(indices), "");
return LLVMBuildLoad(builder, member_ptr, "cache_data");
member_ptr = LLVMBuildGEP2(builder, lp_build_format_cache_type(gallivm), cache, indices, ARRAY_SIZE(indices), "");
return LLVMBuildLoad2(builder, lp_build_format_cache_member_data_type(gallivm), member_ptr, "cache_data");
}
static LLVMValueRef