mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-05 03:08:05 +02:00
ac/llvm: Fix alignment of shared load intrinsics.
After some research, I found out that the alignment needs to be set
on the return value of the load, rather than on the pointer.
Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Tested-by: Michel Dänzer <mdaenzer@redhat.com>
Fixes: 14ad82b4e9 "ac/llvm: Emit more efficient code for load_shared."
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9688>
This commit is contained in:
parent
3413c48375
commit
f5717f9f54
1 changed files with 2 additions and 2 deletions
|
|
@ -2967,9 +2967,9 @@ static LLVMValueRef visit_load_shared(struct ac_nir_context *ctx, const nir_intr
|
|||
LLVMTypeRef result_type = get_def_type(ctx, &instr->dest.ssa);
|
||||
int addr_space = LLVMGetPointerAddressSpace(LLVMTypeOf(ptr));
|
||||
LLVMValueRef derived_ptr = LLVMBuildBitCast(ctx->ac.builder, ptr, LLVMPointerType(result_type, addr_space), "");
|
||||
LLVMSetAlignment(derived_ptr, alignment);
|
||||
|
||||
LLVMValueRef ret = LLVMBuildLoad(ctx->ac.builder, derived_ptr, "");
|
||||
LLVMSetAlignment(ret, alignment);
|
||||
|
||||
return LLVMBuildBitCast(ctx->ac.builder, ret, get_def_type(ctx, &instr->dest.ssa), "");
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue