gallivm: remove legacy pointer_get apis
These are no longer used. Reviewed-by: Mihai Preda <mhpreda@gmail.com> Reviewed-by: Roland Scheidegger <sroland@vmware.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18947>
This commit is contained in:
@@ -41,43 +41,6 @@
|
||||
#include "lp_bld_debug.h"
|
||||
#include "lp_bld_struct.h"
|
||||
|
||||
|
||||
/* Deprecated (used only by llvmpipe); use lp_build_struct_get_ptr2() instead. */
|
||||
LLVMValueRef
|
||||
lp_build_struct_get_ptr(struct gallivm_state *gallivm,
|
||||
LLVMValueRef ptr,
|
||||
unsigned member,
|
||||
const char *name)
|
||||
{
|
||||
LLVMValueRef indices[2];
|
||||
LLVMValueRef member_ptr;
|
||||
assert(LLVMGetTypeKind(LLVMTypeOf(ptr)) == LLVMPointerTypeKind);
|
||||
assert(LLVM_VERSION_MAJOR >= 15 || LLVMGetTypeKind(LLVMGetElementType(LLVMTypeOf(ptr))) == LLVMStructTypeKind);
|
||||
|
||||
indices[0] = lp_build_const_int32(gallivm, 0);
|
||||
indices[1] = lp_build_const_int32(gallivm, member);
|
||||
member_ptr = LLVMBuildGEP(gallivm->builder, ptr, indices, ARRAY_SIZE(indices), "");
|
||||
lp_build_name(member_ptr, "%s.%s_ptr", LLVMGetValueName(ptr), name);
|
||||
return member_ptr;
|
||||
}
|
||||
|
||||
/* Deprecated (used only by llvmpipe); use lp_build_struct_get2() instead. */
|
||||
LLVMValueRef
|
||||
lp_build_struct_get(struct gallivm_state *gallivm,
|
||||
LLVMValueRef ptr,
|
||||
unsigned member,
|
||||
const char *name)
|
||||
{
|
||||
LLVMValueRef member_ptr;
|
||||
LLVMValueRef res;
|
||||
assert(LLVMGetTypeKind(LLVMTypeOf(ptr)) == LLVMPointerTypeKind);
|
||||
assert(LLVM_VERSION_MAJOR >= 15 || LLVMGetTypeKind(LLVMGetElementType(LLVMTypeOf(ptr))) == LLVMStructTypeKind);
|
||||
member_ptr = lp_build_struct_get_ptr(gallivm, ptr, member, name);
|
||||
res = LLVMBuildLoad(gallivm->builder, member_ptr, "");
|
||||
lp_build_name(res, "%s.%s", LLVMGetValueName(ptr), name);
|
||||
return res;
|
||||
}
|
||||
|
||||
LLVMValueRef
|
||||
lp_build_struct_get_ptr2(struct gallivm_state *gallivm,
|
||||
LLVMTypeRef ptr_type,
|
||||
@@ -154,86 +117,6 @@ lp_build_array_get2(struct gallivm_state *gallivm,
|
||||
return res;
|
||||
}
|
||||
|
||||
LLVMValueRef
|
||||
lp_build_array_get_ptr(struct gallivm_state *gallivm,
|
||||
LLVMValueRef ptr,
|
||||
LLVMValueRef index)
|
||||
{
|
||||
LLVMValueRef indices[2];
|
||||
LLVMValueRef element_ptr;
|
||||
assert(LLVMGetTypeKind(LLVMTypeOf(ptr)) == LLVMPointerTypeKind);
|
||||
assert(LLVM_VERSION_MAJOR >= 15 || LLVMGetTypeKind(LLVMGetElementType(LLVMTypeOf(ptr))) == LLVMArrayTypeKind);
|
||||
indices[0] = lp_build_const_int32(gallivm, 0);
|
||||
indices[1] = index;
|
||||
element_ptr = LLVMBuildGEP(gallivm->builder, ptr, indices, ARRAY_SIZE(indices), "");
|
||||
#ifdef DEBUG
|
||||
lp_build_name(element_ptr, "&%s[%s]",
|
||||
LLVMGetValueName(ptr), LLVMGetValueName(index));
|
||||
#endif
|
||||
return element_ptr;
|
||||
}
|
||||
|
||||
|
||||
LLVMValueRef
|
||||
lp_build_array_get(struct gallivm_state *gallivm,
|
||||
LLVMValueRef ptr,
|
||||
LLVMValueRef index)
|
||||
{
|
||||
LLVMValueRef element_ptr;
|
||||
LLVMValueRef res;
|
||||
assert(LLVMGetTypeKind(LLVMTypeOf(ptr)) == LLVMPointerTypeKind);
|
||||
assert(LLVM_VERSION_MAJOR >= 15 || LLVMGetTypeKind(LLVMGetElementType(LLVMTypeOf(ptr))) == LLVMArrayTypeKind);
|
||||
element_ptr = lp_build_array_get_ptr(gallivm, ptr, index);
|
||||
res = LLVMBuildLoad(gallivm->builder, element_ptr, "");
|
||||
#ifdef DEBUG
|
||||
lp_build_name(res, "%s[%s]", LLVMGetValueName(ptr), LLVMGetValueName(index));
|
||||
#endif
|
||||
return res;
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
lp_build_array_set(struct gallivm_state *gallivm,
|
||||
LLVMValueRef ptr,
|
||||
LLVMValueRef index,
|
||||
LLVMValueRef value)
|
||||
{
|
||||
LLVMValueRef element_ptr;
|
||||
assert(LLVMGetTypeKind(LLVMTypeOf(ptr)) == LLVMPointerTypeKind);
|
||||
assert(LLVM_VERSION_MAJOR >= 15 || LLVMGetTypeKind(LLVMGetElementType(LLVMTypeOf(ptr))) == LLVMArrayTypeKind);
|
||||
element_ptr = lp_build_array_get_ptr(gallivm, ptr, index);
|
||||
LLVMBuildStore(gallivm->builder, value, element_ptr);
|
||||
}
|
||||
|
||||
|
||||
LLVMValueRef
|
||||
lp_build_pointer_get(LLVMBuilderRef builder,
|
||||
LLVMValueRef ptr,
|
||||
LLVMValueRef index)
|
||||
{
|
||||
return lp_build_pointer_get_unaligned(builder, ptr, index, 0);
|
||||
}
|
||||
|
||||
|
||||
LLVMValueRef
|
||||
lp_build_pointer_get_unaligned(LLVMBuilderRef builder,
|
||||
LLVMValueRef ptr,
|
||||
LLVMValueRef index,
|
||||
unsigned alignment)
|
||||
{
|
||||
LLVMValueRef element_ptr;
|
||||
LLVMValueRef res;
|
||||
assert(LLVMGetTypeKind(LLVMTypeOf(ptr)) == LLVMPointerTypeKind);
|
||||
element_ptr = LLVMBuildGEP(builder, ptr, &index, 1, "");
|
||||
res = LLVMBuildLoad(builder, element_ptr, "");
|
||||
if (alignment)
|
||||
LLVMSetAlignment(res, alignment);
|
||||
#ifdef DEBUG
|
||||
lp_build_name(res, "%s[%s]", LLVMGetValueName(ptr), LLVMGetValueName(index));
|
||||
#endif
|
||||
return res;
|
||||
}
|
||||
|
||||
LLVMValueRef
|
||||
lp_build_pointer_get_unaligned2(LLVMBuilderRef builder,
|
||||
LLVMTypeRef ptr_type,
|
||||
|
@@ -53,26 +53,6 @@
|
||||
offsetof(_ctype, _cmember))
|
||||
|
||||
|
||||
/**
|
||||
* Get value pointer to a structure member.
|
||||
* Deprecated (used only by llvmpipe); use lp_build_struct_get_ptr2() instead.
|
||||
*/
|
||||
LLVMValueRef
|
||||
lp_build_struct_get_ptr(struct gallivm_state *gallivm,
|
||||
LLVMValueRef ptr,
|
||||
unsigned member,
|
||||
const char *name);
|
||||
|
||||
/**
|
||||
* Get the value of a structure member.
|
||||
* Deprecated (used only by llvmpipe); use lp_build_struct_get2() instead.
|
||||
*/
|
||||
LLVMValueRef
|
||||
lp_build_struct_get(struct gallivm_state *gallivm,
|
||||
LLVMValueRef ptr,
|
||||
unsigned member,
|
||||
const char *name);
|
||||
|
||||
/**
|
||||
* Get value pointer to a structure member.
|
||||
* This takes the explicit LLVM type of ptr, as required by LLVM-15 opaque-pointers.
|
||||
@@ -107,51 +87,6 @@ lp_build_array_get2(struct gallivm_state *gallivm,
|
||||
LLVMValueRef ptr,
|
||||
LLVMValueRef index);
|
||||
|
||||
/**
|
||||
* Get value pointer to an array element.
|
||||
*/
|
||||
LLVMValueRef
|
||||
lp_build_array_get_ptr(struct gallivm_state *gallivm,
|
||||
LLVMValueRef ptr,
|
||||
LLVMValueRef index);
|
||||
|
||||
/**
|
||||
* Get the value of an array element.
|
||||
*/
|
||||
LLVMValueRef
|
||||
lp_build_array_get(struct gallivm_state *gallivm,
|
||||
LLVMValueRef ptr,
|
||||
LLVMValueRef index);
|
||||
|
||||
/**
|
||||
* Set the value of an array element.
|
||||
*/
|
||||
void
|
||||
lp_build_array_set(struct gallivm_state *gallivm,
|
||||
LLVMValueRef ptr,
|
||||
LLVMValueRef index,
|
||||
LLVMValueRef value);
|
||||
|
||||
/**
|
||||
* Get the value of an array element.
|
||||
*/
|
||||
LLVMValueRef
|
||||
lp_build_pointer_get(LLVMBuilderRef builder,
|
||||
LLVMValueRef ptr,
|
||||
LLVMValueRef index);
|
||||
|
||||
/**
|
||||
* Get the value of an array element, with explicit alignment.
|
||||
*
|
||||
* If the element size is different from the alignment this will
|
||||
* cause llvm to emit an unaligned load
|
||||
*/
|
||||
LLVMValueRef
|
||||
lp_build_pointer_get_unaligned(LLVMBuilderRef builder,
|
||||
LLVMValueRef ptr,
|
||||
LLVMValueRef index,
|
||||
unsigned alignment);
|
||||
|
||||
/**
|
||||
* Get the value of an array element.
|
||||
* This takes the explicit LLVM type of ptr, as required by LLVM-15 opaque-pointers.
|
||||
|
Reference in New Issue
Block a user