[artiq] WIP

This commit is contained in:
David Mak 2024-08-15 13:44:31 +08:00
parent c00f6939e9
commit f4a22dbee9
1 changed files with 7 additions and 24 deletions

View File

@ -647,36 +647,20 @@ fn format_rpc_ret<'ctx>(
.unwrap())
},
|generator, ctx| {
// let data_addr = ctx
// .builder
// .build_load(
// ctx.builder
// .build_bitcast(data_addr, llvm_ppi8, "")
// .map(BasicValueEnum::into_pointer_value)
// .unwrap(),
// "",
// )
// .map(BasicValueEnum::into_pointer_value)
// .unwrap();
//
// call_memcpy_generic(
// ctx,
// ndarray.ptr_to_data(ctx),
// data_addr,
// llvm_pdata_sizeof,
// llvm_i1.const_zero(),
// );
let phi = phi.as_basic_value().into_pointer_value();
call_memcpy_generic(
ctx,
ndarray.ptr_to_data(ctx),
buffer.base_ptr(ctx, generator),
phi,
llvm_pdata_sizeof,
llvm_i1.const_zero(),
);
let pbuffer_dims_begin = unsafe {
buffer.ptr_offset_unchecked(ctx, generator, &llvm_pdata_sizeof, None)
};
// let pbuffer_dims_begin = unsafe {
// buffer.ptr_offset_unchecked(ctx, generator, &llvm_pdata_sizeof, None)
// };
let pbuffer_dims_begin =
unsafe { ctx.builder.build_in_bounds_gep(phi, &[llvm_pdata_sizeof], "") };
call_memcpy_generic(
ctx,
ndarray.dim_sizes().base_ptr(ctx, generator),
@ -760,7 +744,6 @@ fn format_rpc_ret<'ctx>(
ctx.builder.build_unconditional_branch(head_bb).unwrap();
ctx.builder.position_at_end(tail_bb);
ctx.builder.build_load(slot, "rpc.result").unwrap()
}
};