From 9a87373b48e7b4391e040e34741fe6b129d9bf09 Mon Sep 17 00:00:00 2001 From: David Mak Date: Thu, 15 Aug 2024 13:18:35 +0800 Subject: [PATCH] [artiq] WIP --- nac3artiq/src/codegen.rs | 41 ++++++++++++++++++++-------------------- 1 file changed, 21 insertions(+), 20 deletions(-) diff --git a/nac3artiq/src/codegen.rs b/nac3artiq/src/codegen.rs index 4f16acf9..474f7a86 100644 --- a/nac3artiq/src/codegen.rs +++ b/nac3artiq/src/codegen.rs @@ -647,26 +647,27 @@ fn format_rpc_ret<'ctx>( .unwrap()) }, |generator, ctx| { - let data_addr = phi.as_basic_value().into_pointer_value(); - 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 data_addr = phi.as_basic_value().into_pointer_value(); + // 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(), + // ); + call_memcpy_generic(ctx, ndarray.ptr_to_data(ctx), phi.as_basic_value().into_pointer_value(), llvm_pdata_sizeof, llvm_i1.const_zero()); let pbuffer_dims_begin = unsafe { buffer.ptr_offset_unchecked(ctx, generator, &llvm_pdata_sizeof, None)