Commit 24bfb2a7 authored by Dave Airlie's avatar Dave Airlie
Browse files

gallivm: remove legacy pointer_get apis

These are no longer used.
parent 221f9a61
Pipeline #698825 waiting for manual action with stages
......@@ -117,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,
......
......@@ -87,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.
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment