WIP - [artiq] Test
This commit is contained in:
parent
4b6e5e488e
commit
1e5b68fc04
|
@ -606,24 +606,11 @@ fn format_rpc_ret<'ctx>(
|
|||
// let buffer_size =
|
||||
// ctx.builder.build_int_add(dims_buf_sz, llvm_pdata_sizeof, "").unwrap();
|
||||
let buffer_size = llvm_usize.const_int(32, false);
|
||||
// let buffer_size = ctx.builder.build_left_shift(
|
||||
// ctx.builder.build_int_add(
|
||||
// ctx.builder.build_right_shift(
|
||||
// buffer_size,
|
||||
// llvm_usize.const_int(2, false),
|
||||
// false,
|
||||
// "",
|
||||
// ).unwrap(),
|
||||
// llvm_usize.const_int(1, false),
|
||||
// "",
|
||||
// ).unwrap(),
|
||||
// llvm_usize.const_int(2, false),
|
||||
// "",
|
||||
// ).unwrap();
|
||||
|
||||
let buffer =
|
||||
ctx.builder.build_array_alloca(llvm_i8, buffer_size, "rpc.buffer").unwrap();
|
||||
let buffer = ArraySliceValue::from_ptr_val(buffer, buffer_size, Some("rpc.buffer"));
|
||||
ctx.builder.build_array_alloca(llvm_pi8, buffer_size, "rpc.buffer").unwrap();
|
||||
let buffer = ctx.builder.build_bitcast(buffer, llvm_pi8, "").map(BasicValueEnum::into_pointer_value).unwrap();
|
||||
let buffer = ArraySliceValue::from_ptr_val(buffer, buffer_size, Some("rpc.buffer.ptr"));
|
||||
|
||||
let i_addr = ctx.builder.build_alloca(llvm_usize, "i.addr").unwrap();
|
||||
ctx.builder.build_unconditional_branch(head_bb).unwrap();
|
||||
|
@ -755,22 +742,9 @@ fn format_rpc_ret<'ctx>(
|
|||
ctx.builder.build_conditional_branch(is_done, tail_bb, alloc_bb).unwrap();
|
||||
ctx.builder.position_at_end(alloc_bb);
|
||||
|
||||
let alloc_size = ctx.builder.build_left_shift(
|
||||
ctx.builder.build_int_add(
|
||||
ctx.builder.build_right_shift(
|
||||
alloc_size,
|
||||
llvm_usize.const_int(2, false),
|
||||
false,
|
||||
"",
|
||||
).unwrap(),
|
||||
llvm_usize.const_int(1, false),
|
||||
"",
|
||||
).unwrap(),
|
||||
llvm_usize.const_int(2, false),
|
||||
"",
|
||||
).unwrap();
|
||||
let alloc_ptr =
|
||||
ctx.builder.build_array_alloca(llvm_i8, alloc_size, "rpc.alloc").unwrap();
|
||||
ctx.builder.build_array_alloca(llvm_pi8, alloc_size, "rpc.alloc").unwrap();
|
||||
let alloc_ptr = ctx.builder.build_bitcast(alloc_ptr, llvm_pi8, "").map(BasicValueEnum::into_pointer_value).unwrap();
|
||||
phi.add_incoming(&[(&alloc_ptr, alloc_bb)]);
|
||||
let i =
|
||||
ctx.builder.build_load(i_addr, "i").map(BasicValueEnum::into_int_value).unwrap();
|
||||
|
|
Loading…
Reference in New Issue