WIP - [artiq] Force completion

This commit is contained in:
David Mak 2024-08-15 02:42:31 +08:00
parent 710038288a
commit 0c18154d15
1 changed files with 4 additions and 6 deletions

View File

@ -596,7 +596,7 @@ fn format_rpc_ret<'ctx>(
let llvm_pdata_sizeof = ctx
.builder
.build_int_truncate_or_bit_cast(
llvm_ret_ty.element_type().ptr_type(AddressSpace::default()).size_of(),
llvm_ret_ty.element_type().size_of().unwrap(),
llvm_usize,
"",
)
@ -621,8 +621,8 @@ fn format_rpc_ret<'ctx>(
phi.add_incoming(&[(&buffer.base_ptr(ctx, generator), prehead_bb)]);
let alloc_size = ctx
.build_call_or_invoke(rpc_recv, &[phi.as_basic_value()], "rpc.size.next")
.unwrap()
.into_int_value();
.map(BasicValueEnum::into_int_value)
.unwrap();
// Parse metadata block(s) for ndarrays
gen_if_callback(
@ -680,9 +680,7 @@ fn format_rpc_ret<'ctx>(
ctx.builder.position_at_end(alloc_bb);
let alloc_ptr =
ctx.builder.build_array_alloca(llvm_pi8, alloc_size, "rpc.alloc").unwrap();
let alloc_ptr =
ctx.builder.build_bitcast(alloc_ptr, llvm_pi8, "rpc.alloc.ptr").unwrap();
ctx.builder.build_array_alloca(llvm_i8, alloc_size, "rpc.alloc").unwrap();
phi.add_incoming(&[(&alloc_ptr, alloc_bb)]);
let i =
ctx.builder.build_load(i_addr, "i").map(BasicValueEnum::into_int_value).unwrap();