Skip to content

Commit

Permalink
move circuit allocas to init block
Browse files Browse the repository at this point in the history
  • Loading branch information
edg-l committed Oct 21, 2024
1 parent 4ba9e16 commit 604e1cc
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/libfuncs/circuit.rs
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ fn build_add_input<'ctx, 'this>(
middle_insert_block.insert_value(context, location, accumulator, next_length, 0)?;

// Get pointer to accumulator with alloc and store
let accumulator_ptr = middle_insert_block.alloca1(
let accumulator_ptr = helper.init_block().alloca1(
context,
location,
accumulator.r#type(),
Expand Down Expand Up @@ -261,10 +261,12 @@ fn build_add_input<'ctx, 'this>(

// Alloc return data
let data_ptr =
last_insert_block.alloca1(context, location, data_type, data_layout.align())?;
helper
.init_block()
.alloca1(context, location, data_type, data_layout.align())?;

// Get pointer to accumulator with alloc and store
let accumulator_ptr = last_insert_block.alloca1(
let accumulator_ptr = helper.init_block().alloca1(
context,
location,
accumulator.r#type(),
Expand Down

0 comments on commit 604e1cc

Please sign in to comment.