diff --git a/compiler/noirc_evaluator/src/ssa/opt/mem2reg.rs b/compiler/noirc_evaluator/src/ssa/opt/mem2reg.rs index ed311470544..5cfcf51c3db 100644 --- a/compiler/noirc_evaluator/src/ssa/opt/mem2reg.rs +++ b/compiler/noirc_evaluator/src/ssa/opt/mem2reg.rs @@ -329,7 +329,7 @@ impl<'f> PerFunctionContext<'f> { // as well. We can't do this if there are multiple blocks since subsequent blocks may // reference these stores. if self.post_order.as_slice().len() == 1 { - self.remove_stores_that_do_not_alias_parameters(&references); + self.remove_stores_that_do_not_alias_parameters_or_returns(&references); } self.blocks.insert(block, references); @@ -384,17 +384,26 @@ impl<'f> PerFunctionContext<'f> { /// Add all instructions in `last_stores` to `self.instructions_to_remove` which do not /// possibly alias any parameters of the given function. - fn remove_stores_that_do_not_alias_parameters(&mut self, references: &Block) { + fn remove_stores_that_do_not_alias_parameters_or_returns(&mut self, references: &Block) { let reference_parameters = self.reference_parameters(); for (allocation, instruction) in &references.last_stores { let aliases = references.get_aliases_for_value(*allocation); + let allocation_aliases_parameter = aliases.any(|alias| reference_parameters.contains(&alias)); // If `allocation_aliases_parameter` is known to be false - if allocation_aliases_parameter == Some(false) { - self.instructions_to_remove.insert(*instruction); + if allocation_aliases_parameter != Some(false) { + continue; + } + + let allocation_aliases_input_reference = + aliases.any(|alias| self.instruction_input_references.contains(&alias)); + if allocation_aliases_input_reference != Some(false) { + continue; } + + self.instructions_to_remove.insert(*instruction); } } @@ -513,18 +522,26 @@ impl<'f> PerFunctionContext<'f> { Instruction::ArrayGet { array, .. } => { let result = self.inserter.function.dfg.instruction_results(instruction)[0]; - let array = *array; - let array_typ = self.inserter.function.dfg.type_of_value(array); - if array_typ.contains_reference() { + if self.inserter.function.dfg.type_of_value(result).contains_reference() { + let array = *array; self.instruction_input_references .extend(references.get_aliases_for_value(array).iter()); references.mark_value_used(array, self.inserter.function); - let expression = Expression::ArrayElement(array); + // An expression for the array might already exist, so try to fetch it first + let expression = references.expressions.get(&array).copied(); + let expression = expression.unwrap_or(Expression::Other(array)); if let Some(aliases) = references.aliases.get_mut(&expression) { aliases.insert(result); } + + // In this SSA: + // + // v2 = array_get v0, index v1 -> Field + // + // make v2 point to v0 so they share the same alias set + references.expressions.insert(result, expression); } } Instruction::ArraySet { array, value, .. } => { @@ -535,7 +552,8 @@ impl<'f> PerFunctionContext<'f> { let result = self.inserter.function.dfg.instruction_results(instruction)[0]; let array = *array; - let expression = Expression::ArrayElement(array); + let expression = references.expressions.get(&array).copied(); + let expression = expression.unwrap_or(Expression::Other(array)); let mut aliases = if let Some(aliases) = references.aliases.get_mut(&expression) { @@ -733,8 +751,8 @@ impl<'f> PerFunctionContext<'f> { // We need to appropriately mark each alias of a reference as being used as a return terminator argument. // This prevents us potentially removing a last store from a preceding block or is altered within another function. for return_value in return_values { - self.instruction_input_references - .extend(references.get_aliases_for_value(*return_value).iter()); + let aliases = references.get_aliases_for_value(*return_value); + self.instruction_input_references.extend(aliases.iter()); } // Removing all `last_stores` for each returned reference is more important here // than setting them all to unknown since no other block should @@ -1558,8 +1576,43 @@ mod tests { #[test] fn removes_last_store_in_single_block() { + let src = " + brillig(inline) impure fn main f0 { + b0(): + v0 = allocate -> &mut [Field; 2] + v1 = load v0 -> [Field; 2] + store v1 at v0 + return + } + + brillig(inline) impure fn append_note_hashes_with_logs f1 { + b0(v0: &mut [Field; 2]): + return + } + "; + + let ssa = Ssa::from_str(src).unwrap(); + + let ssa = ssa.mem2reg(); + assert_ssa_snapshot!(ssa, @r" + brillig(inline) impure fn main f0 { + b0(): + v0 = allocate -> &mut [Field; 2] + v1 = load v0 -> [Field; 2] + return + } + brillig(inline) impure fn append_note_hashes_with_logs f1 { + b0(v0: &mut [Field; 2]): + return + } + "); + } + + #[test] + fn does_not_remove_last_store_in_single_block() { // Even though v0 is a reference passed to a function, the store that comes next - // can be removed as it is later never read, and this is the only block in the function. + // isn't removed because it's considered an "input reference" and we can't currently + // tell if that value is going to be returned from the function. let src = " brillig(inline) impure fn main f0 { b0(): @@ -1585,6 +1638,7 @@ mod tests { v0 = allocate -> &mut [Field; 2] call f1(v0) v2 = load v0 -> [Field; 2] + store v2 at v0 return } brillig(inline) impure fn append_note_hashes_with_logs f1 { @@ -1957,4 +2011,72 @@ mod tests { } "); } + + #[test] + fn does_not_reuse_load_from_aliased_array_element() { + let src = " + brillig(inline) fn main f0 { + b0(v0: &mut Field, v1: &mut Field, v2: u32): + v3 = make_array [v0] : [&mut Field; 1] + v4 = array_set v3, index v2, value v1 + v5 = load v0 -> Field + v6 = array_get v4, index v2 -> &mut Field + store Field 0 at v6 + v7 = load v0 -> Field + return v7 + } + "; + + let ssa = Ssa::from_str(src).unwrap(); + let ssa = ssa.mem2reg(); + assert_ssa_snapshot!(ssa, @r#" + brillig(inline) fn main f0 { + b0(v0: &mut Field, v1: &mut Field, v2: u32): + v3 = make_array [v0] : [&mut Field; 1] + v4 = array_set v3, index v2, value v1 + v5 = load v0 -> Field + constrain v2 == u32 0, "Index out of bounds" + v7 = array_get v4, index u32 0 -> &mut Field + store Field 0 at v7 + v9 = load v0 -> Field + return v9 + } + "#); + } + + #[test] + fn does_not_remove_store_from_aliased_array_element() { + let src = " + brillig(inline) fn main f0 { + b0(v0: u32): + v1 = allocate -> &mut Field + store Field 0 at v1 + v3 = make_array [v1] : [&mut Field; 1] + v5 = array_set v3, index v0, value v1 + v6 = array_get v5, index v0 -> &mut Field + store Field 100 at v6 + v8 = load v1 -> Field + constrain v8 == Field 100 + return v8 + } + "; + + let ssa = Ssa::from_str(src).unwrap(); + let ssa = ssa.mem2reg(); + assert_ssa_snapshot!(ssa, @r#" + brillig(inline) fn main f0 { + b0(v0: u32): + v1 = allocate -> &mut Field + store Field 0 at v1 + v3 = make_array [v1] : [&mut Field; 1] + v4 = array_set v3, index v0, value v1 + constrain v0 == u32 0, "Index out of bounds" + v6 = array_get v4, index u32 0 -> &mut Field + store Field 100 at v6 + v8 = load v1 -> Field + constrain v8 == Field 100 + return v8 + } + "#); + } } diff --git a/compiler/noirc_evaluator/src/ssa/ssa_gen/program.rs b/compiler/noirc_evaluator/src/ssa/ssa_gen/program.rs index d52a4b5b77a..c5d923e388d 100644 --- a/compiler/noirc_evaluator/src/ssa/ssa_gen/program.rs +++ b/compiler/noirc_evaluator/src/ssa/ssa_gen/program.rs @@ -165,6 +165,12 @@ impl Ssa { } } +impl std::fmt::Display for Ssa { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + self.print_without_locations().fmt(f) + } +} + #[cfg(test)] mod test { use crate::ssa::ir::map::Id; diff --git a/test_programs/execution_success/regression_9657/Nargo.toml b/test_programs/execution_success/regression_9657/Nargo.toml new file mode 100644 index 00000000000..0d6d3038951 --- /dev/null +++ b/test_programs/execution_success/regression_9657/Nargo.toml @@ -0,0 +1,6 @@ +[package] +name = "regression_9657" +type = "bin" +authors = [""] + +[dependencies] diff --git a/test_programs/execution_success/regression_9657/Prover.toml b/test_programs/execution_success/regression_9657/Prover.toml new file mode 100644 index 00000000000..c9f163f5756 --- /dev/null +++ b/test_programs/execution_success/regression_9657/Prover.toml @@ -0,0 +1 @@ +v2 = 0 diff --git a/test_programs/execution_success/regression_9657/src/main.nr b/test_programs/execution_success/regression_9657/src/main.nr new file mode 100644 index 00000000000..1ed1630eccc --- /dev/null +++ b/test_programs/execution_success/regression_9657/src/main.nr @@ -0,0 +1,14 @@ +unconstrained fn main(v2: u32) { + let v0 = &mut 0; + let v7 = foo(v0, v0, v2); + assert_eq(v7, 100); +} + +unconstrained fn foo(v0: &mut Field, v1: &mut Field, v2: u32) -> Field { + let mut v3 = [v0]; + v3[v2] = v1; + let _v5 = *v0; + let v6 = v3[v2]; + *v6 = 100; + *v0 +} diff --git a/tooling/nargo_cli/tests/snapshots/execution_success/brillig_rc_regression_6123/execute__tests__force_brillig_false_inliner_-9223372036854775808.snap b/tooling/nargo_cli/tests/snapshots/execution_success/brillig_rc_regression_6123/execute__tests__force_brillig_false_inliner_-9223372036854775808.snap index 25c7f6c4c10..70ece965abb 100644 --- a/tooling/nargo_cli/tests/snapshots/execution_success/brillig_rc_regression_6123/execute__tests__force_brillig_false_inliner_-9223372036854775808.snap +++ b/tooling/nargo_cli/tests/snapshots/execution_success/brillig_rc_regression_6123/execute__tests__force_brillig_false_inliner_-9223372036854775808.snap @@ -35,7 +35,7 @@ expression: artifact "return value indices : []", "BRILLIG CALL func 0: inputs: [], outputs: []", "unconstrained func 0", - "[Const { destination: Direct(2), bit_size: Integer(U32), value: 1 }, Const { destination: Direct(1), bit_size: Integer(U32), value: 32838 }, Const { destination: Direct(0), bit_size: Integer(U32), value: 3 }, Const { destination: Relative(1), bit_size: Integer(U32), value: 0 }, Const { destination: Relative(2), bit_size: Integer(U32), value: 0 }, CalldataCopy { destination_address: Direct(32838), size_address: Relative(1), offset_address: Relative(2) }, Call { location: 11 }, Call { location: 15 }, Const { destination: Relative(1), bit_size: Integer(U32), value: 32838 }, Const { destination: Relative(2), bit_size: Integer(U32), value: 0 }, Stop { return_data: HeapVector { pointer: Relative(1), size: Relative(2) } }, Const { destination: Direct(32835), bit_size: Integer(U32), value: 0 }, Const { destination: Direct(32836), bit_size: Integer(U32), value: 1 }, Const { destination: Direct(32837), bit_size: Integer(U32), value: 2 }, Return, Call { location: 66 }, Const { destination: Relative(1), bit_size: Field, value: 0 }, Mov { destination: Relative(2), source: Direct(1) }, Const { destination: Relative(3), bit_size: Integer(U32), value: 3 }, BinaryIntOp { destination: Direct(1), op: Add, bit_size: U32, lhs: Direct(1), rhs: Relative(3) }, IndirectConst { destination_pointer: Relative(2), bit_size: Integer(U32), value: 1 }, BinaryIntOp { destination: Relative(3), op: Add, bit_size: U32, lhs: Relative(2), rhs: Direct(2) }, Mov { destination: Relative(4), source: Relative(3) }, Store { destination_pointer: Relative(4), source: Relative(1) }, BinaryIntOp { destination: Relative(4), op: Add, bit_size: U32, lhs: Relative(4), rhs: Direct(2) }, Store { destination_pointer: Relative(4), source: Relative(1) }, Load { destination: Relative(1), source_pointer: Relative(2) }, Const { destination: Relative(3), bit_size: Integer(U32), value: 0 }, BinaryIntOp { destination: Relative(4), op: Equals, bit_size: U32, lhs: Relative(3), rhs: Relative(1) }, Not { destination: Relative(4), source: Relative(4), bit_size: U1 }, JumpIf { condition: Relative(4), location: 32 }, Call { location: 72 }, BinaryIntOp { destination: Relative(1), op: Add, bit_size: U32, lhs: Relative(1), rhs: Direct(2) }, Store { destination_pointer: Relative(2), source: Relative(1) }, Mov { destination: Relative(1), source: Direct(1) }, BinaryIntOp { destination: Direct(1), op: Add, bit_size: U32, lhs: Direct(1), rhs: Direct(2) }, Store { destination_pointer: Relative(1), source: Relative(2) }, Mov { destination: Relative(4), source: Direct(1) }, BinaryIntOp { destination: Direct(1), op: Add, bit_size: U32, lhs: Direct(1), rhs: Direct(2) }, Store { destination_pointer: Relative(4), source: Direct(32835) }, Mov { destination: Relative(5), source: Direct(1) }, BinaryIntOp { destination: Direct(1), op: Add, bit_size: U32, lhs: Direct(1), rhs: Direct(2) }, Store { destination_pointer: Relative(5), source: Relative(2) }, Mov { destination: Relative(2), source: Direct(1) }, BinaryIntOp { destination: Direct(1), op: Add, bit_size: U32, lhs: Direct(1), rhs: Direct(2) }, Store { destination_pointer: Relative(2), source: Direct(32835) }, Const { destination: Relative(6), bit_size: Integer(U32), value: 7 }, Mov { destination: Relative(7), source: Direct(0) }, Mov { destination: Relative(8), source: Relative(1) }, Mov { destination: Relative(9), source: Relative(4) }, Mov { destination: Relative(10), source: Relative(5) }, Mov { destination: Relative(11), source: Relative(2) }, Mov { destination: Relative(12), source: Direct(32837) }, BinaryIntOp { destination: Direct(0), op: Add, bit_size: U32, lhs: Direct(0), rhs: Relative(6) }, Call { location: 75 }, Mov { destination: Direct(0), source: Relative(0) }, Load { destination: Relative(2), source_pointer: Relative(1) }, Load { destination: Relative(1), source_pointer: Relative(2) }, Const { destination: Relative(4), bit_size: Integer(U32), value: 0 }, BinaryIntOp { destination: Relative(5), op: Equals, bit_size: U32, lhs: Relative(4), rhs: Relative(1) }, Not { destination: Relative(5), source: Relative(5), bit_size: U1 }, JumpIf { condition: Relative(5), location: 63 }, Call { location: 72 }, BinaryIntOp { destination: Relative(1), op: Add, bit_size: U32, lhs: Relative(1), rhs: Direct(2) }, Store { destination_pointer: Relative(2), source: Relative(1) }, Return, Const { destination: Direct(32772), bit_size: Integer(U32), value: 30720 }, BinaryIntOp { destination: Direct(32771), op: LessThan, bit_size: U32, lhs: Direct(0), rhs: Direct(32772) }, JumpIf { condition: Direct(32771), location: 71 }, IndirectConst { destination_pointer: Direct(1), bit_size: Integer(U64), value: 17843811134343075018 }, Trap { revert_data: HeapVector { pointer: Direct(1), size: Direct(2) } }, Return, IndirectConst { destination_pointer: Direct(1), bit_size: Integer(U64), value: 12049594436772143978 }, Trap { revert_data: HeapVector { pointer: Direct(1), size: Direct(2) } }, Return, Call { location: 66 }, Load { destination: Relative(7), source_pointer: Relative(1) }, Load { destination: Relative(8), source_pointer: Relative(2) }, Load { destination: Relative(9), source_pointer: Relative(7) }, Const { destination: Relative(10), bit_size: Integer(U32), value: 0 }, BinaryIntOp { destination: Relative(11), op: Equals, bit_size: U32, lhs: Relative(10), rhs: Relative(9) }, Not { destination: Relative(11), source: Relative(11), bit_size: U1 }, JumpIf { condition: Relative(11), location: 84 }, Call { location: 72 }, BinaryIntOp { destination: Relative(9), op: Add, bit_size: U32, lhs: Relative(9), rhs: Direct(2) }, Store { destination_pointer: Relative(7), source: Relative(9) }, Mov { destination: Relative(6), source: Direct(32835) }, Jump { location: 88 }, BinaryIntOp { destination: Relative(3), op: LessThan, bit_size: U32, lhs: Relative(6), rhs: Direct(32837) }, JumpIf { condition: Relative(3), location: 92 }, Jump { location: 91 }, Return, BinaryIntOp { destination: Relative(3), op: LessThan, bit_size: U32, lhs: Relative(6), rhs: Relative(5) }, JumpIf { condition: Relative(3), location: 95 }, Jump { location: 109 }, BinaryIntOp { destination: Relative(3), op: Add, bit_size: U32, lhs: Relative(8), rhs: Relative(6) }, BinaryIntOp { destination: Relative(4), op: LessThanEquals, bit_size: U32, lhs: Relative(8), rhs: Relative(3) }, JumpIf { condition: Relative(4), location: 99 }, Call { location: 112 }, Cast { destination: Relative(4), source: Relative(3), bit_size: Field }, Const { destination: Relative(3), bit_size: Integer(U32), value: 9 }, Mov { destination: Relative(9), source: Direct(0) }, Mov { destination: Relative(10), source: Relative(1) }, Mov { destination: Relative(11), source: Relative(2) }, Mov { destination: Relative(12), source: Relative(4) }, BinaryIntOp { destination: Direct(0), op: Add, bit_size: U32, lhs: Direct(0), rhs: Relative(3) }, Call { location: 115 }, Mov { destination: Direct(0), source: Relative(0) }, Jump { location: 109 }, BinaryIntOp { destination: Relative(3), op: Add, bit_size: U32, lhs: Relative(6), rhs: Direct(32836) }, Mov { destination: Relative(6), source: Relative(3) }, Jump { location: 88 }, IndirectConst { destination_pointer: Direct(1), bit_size: Integer(U64), value: 5019202896831570965 }, Trap { revert_data: HeapVector { pointer: Direct(1), size: Direct(2) } }, Return, Call { location: 66 }, Load { destination: Relative(4), source_pointer: Relative(2) }, BinaryIntOp { destination: Relative(5), op: LessThan, bit_size: U32, lhs: Relative(4), rhs: Direct(32837) }, Const { destination: Relative(6), bit_size: Integer(U1), value: 1 }, JumpIf { condition: Relative(5), location: 121 }, Call { location: 136 }, Load { destination: Relative(5), source_pointer: Relative(1) }, Mov { destination: Direct(32771), source: Relative(5) }, Const { destination: Direct(32772), bit_size: Integer(U32), value: 3 }, Call { location: 139 }, Mov { destination: Relative(6), source: Direct(32773) }, BinaryIntOp { destination: Relative(7), op: Add, bit_size: U32, lhs: Relative(6), rhs: Direct(2) }, BinaryIntOp { destination: Relative(8), op: Add, bit_size: U32, lhs: Relative(7), rhs: Relative(4) }, Store { destination_pointer: Relative(8), source: Relative(3) }, BinaryIntOp { destination: Relative(3), op: Add, bit_size: U32, lhs: Relative(4), rhs: Direct(32836) }, BinaryIntOp { destination: Relative(5), op: LessThanEquals, bit_size: U32, lhs: Relative(4), rhs: Relative(3) }, JumpIf { condition: Relative(5), location: 133 }, Call { location: 112 }, Store { destination_pointer: Relative(1), source: Relative(6) }, Store { destination_pointer: Relative(2), source: Relative(3) }, Return, IndirectConst { destination_pointer: Direct(1), bit_size: Integer(U64), value: 5727012404371710682 }, Trap { revert_data: HeapVector { pointer: Direct(1), size: Direct(2) } }, Return, Load { destination: Direct(32774), source_pointer: Direct(32771) }, BinaryIntOp { destination: Direct(32775), op: Equals, bit_size: U32, lhs: Direct(32774), rhs: Direct(2) }, JumpIf { condition: Direct(32775), location: 143 }, Jump { location: 145 }, Mov { destination: Direct(32773), source: Direct(32771) }, Jump { location: 160 }, Mov { destination: Direct(32773), source: Direct(1) }, BinaryIntOp { destination: Direct(1), op: Add, bit_size: U32, lhs: Direct(1), rhs: Direct(32772) }, BinaryIntOp { destination: Direct(32777), op: Add, bit_size: U32, lhs: Direct(32771), rhs: Direct(32772) }, Mov { destination: Direct(32778), source: Direct(32771) }, Mov { destination: Direct(32779), source: Direct(32773) }, BinaryIntOp { destination: Direct(32780), op: Equals, bit_size: U32, lhs: Direct(32778), rhs: Direct(32777) }, JumpIf { condition: Direct(32780), location: 157 }, Load { destination: Direct(32776), source_pointer: Direct(32778) }, Store { destination_pointer: Direct(32779), source: Direct(32776) }, BinaryIntOp { destination: Direct(32778), op: Add, bit_size: U32, lhs: Direct(32778), rhs: Direct(2) }, BinaryIntOp { destination: Direct(32779), op: Add, bit_size: U32, lhs: Direct(32779), rhs: Direct(2) }, Jump { location: 150 }, IndirectConst { destination_pointer: Direct(32773), bit_size: Integer(U32), value: 1 }, BinaryIntOp { destination: Direct(32774), op: Sub, bit_size: U32, lhs: Direct(32774), rhs: Direct(2) }, Jump { location: 160 }, Return]" + "[Const { destination: Direct(2), bit_size: Integer(U32), value: 1 }, Const { destination: Direct(1), bit_size: Integer(U32), value: 32838 }, Const { destination: Direct(0), bit_size: Integer(U32), value: 3 }, Const { destination: Relative(1), bit_size: Integer(U32), value: 0 }, Const { destination: Relative(2), bit_size: Integer(U32), value: 0 }, CalldataCopy { destination_address: Direct(32838), size_address: Relative(1), offset_address: Relative(2) }, Call { location: 11 }, Call { location: 15 }, Const { destination: Relative(1), bit_size: Integer(U32), value: 32838 }, Const { destination: Relative(2), bit_size: Integer(U32), value: 0 }, Stop { return_data: HeapVector { pointer: Relative(1), size: Relative(2) } }, Const { destination: Direct(32835), bit_size: Integer(U32), value: 0 }, Const { destination: Direct(32836), bit_size: Integer(U32), value: 1 }, Const { destination: Direct(32837), bit_size: Integer(U32), value: 2 }, Return, Call { location: 112 }, Const { destination: Relative(1), bit_size: Field, value: 0 }, Mov { destination: Relative(2), source: Direct(1) }, Const { destination: Relative(3), bit_size: Integer(U32), value: 3 }, BinaryIntOp { destination: Direct(1), op: Add, bit_size: U32, lhs: Direct(1), rhs: Relative(3) }, IndirectConst { destination_pointer: Relative(2), bit_size: Integer(U32), value: 1 }, BinaryIntOp { destination: Relative(3), op: Add, bit_size: U32, lhs: Relative(2), rhs: Direct(2) }, Mov { destination: Relative(4), source: Relative(3) }, Store { destination_pointer: Relative(4), source: Relative(1) }, BinaryIntOp { destination: Relative(4), op: Add, bit_size: U32, lhs: Relative(4), rhs: Direct(2) }, Store { destination_pointer: Relative(4), source: Relative(1) }, Load { destination: Relative(1), source_pointer: Relative(2) }, Const { destination: Relative(3), bit_size: Integer(U32), value: 0 }, BinaryIntOp { destination: Relative(4), op: Equals, bit_size: U32, lhs: Relative(3), rhs: Relative(1) }, Not { destination: Relative(4), source: Relative(4), bit_size: U1 }, JumpIf { condition: Relative(4), location: 32 }, Call { location: 118 }, BinaryIntOp { destination: Relative(1), op: Add, bit_size: U32, lhs: Relative(1), rhs: Direct(2) }, Store { destination_pointer: Relative(2), source: Relative(1) }, Mov { destination: Relative(1), source: Direct(1) }, BinaryIntOp { destination: Direct(1), op: Add, bit_size: U32, lhs: Direct(1), rhs: Direct(2) }, Store { destination_pointer: Relative(1), source: Relative(2) }, Mov { destination: Relative(4), source: Direct(1) }, BinaryIntOp { destination: Direct(1), op: Add, bit_size: U32, lhs: Direct(1), rhs: Direct(2) }, Store { destination_pointer: Relative(4), source: Direct(32835) }, Mov { destination: Relative(5), source: Direct(1) }, BinaryIntOp { destination: Direct(1), op: Add, bit_size: U32, lhs: Direct(1), rhs: Direct(2) }, Store { destination_pointer: Relative(5), source: Relative(2) }, Mov { destination: Relative(2), source: Direct(1) }, BinaryIntOp { destination: Direct(1), op: Add, bit_size: U32, lhs: Direct(1), rhs: Direct(2) }, Store { destination_pointer: Relative(2), source: Direct(32835) }, Const { destination: Relative(6), bit_size: Integer(U32), value: 7 }, Mov { destination: Relative(7), source: Direct(0) }, Mov { destination: Relative(8), source: Relative(1) }, Mov { destination: Relative(9), source: Relative(4) }, Mov { destination: Relative(10), source: Relative(5) }, Mov { destination: Relative(11), source: Relative(2) }, Mov { destination: Relative(12), source: Direct(32837) }, BinaryIntOp { destination: Direct(0), op: Add, bit_size: U32, lhs: Direct(0), rhs: Relative(6) }, Call { location: 121 }, Mov { destination: Direct(0), source: Relative(0) }, Load { destination: Relative(6), source_pointer: Relative(5) }, Load { destination: Relative(7), source_pointer: Relative(2) }, Const { destination: Relative(8), bit_size: Field, value: 27 }, Mov { destination: Direct(32771), source: Relative(6) }, Const { destination: Direct(32772), bit_size: Integer(U32), value: 3 }, Call { location: 158 }, Mov { destination: Relative(9), source: Direct(32773) }, BinaryIntOp { destination: Relative(10), op: Add, bit_size: U32, lhs: Relative(9), rhs: Direct(32837) }, Store { destination_pointer: Relative(10), source: Relative(8) }, Store { destination_pointer: Relative(5), source: Relative(9) }, Store { destination_pointer: Relative(2), source: Relative(7) }, Load { destination: Relative(2), source_pointer: Relative(1) }, Load { destination: Relative(5), source_pointer: Relative(2) }, Const { destination: Relative(6), bit_size: Integer(U32), value: 0 }, BinaryIntOp { destination: Relative(7), op: Equals, bit_size: U32, lhs: Relative(6), rhs: Relative(5) }, Not { destination: Relative(7), source: Relative(7), bit_size: U1 }, JumpIf { condition: Relative(7), location: 74 }, Call { location: 118 }, BinaryIntOp { destination: Relative(5), op: Add, bit_size: U32, lhs: Relative(5), rhs: Direct(2) }, Store { destination_pointer: Relative(2), source: Relative(5) }, BinaryIntOp { destination: Relative(7), op: Add, bit_size: U32, lhs: Relative(2), rhs: Direct(32836) }, Load { destination: Relative(5), source_pointer: Relative(7) }, Load { destination: Relative(7), source_pointer: Relative(2) }, Const { destination: Relative(8), bit_size: Integer(U32), value: 0 }, BinaryIntOp { destination: Relative(9), op: Equals, bit_size: U32, lhs: Relative(8), rhs: Relative(7) }, Not { destination: Relative(9), source: Relative(9), bit_size: U1 }, JumpIf { condition: Relative(9), location: 84 }, Call { location: 118 }, BinaryIntOp { destination: Relative(7), op: Add, bit_size: U32, lhs: Relative(7), rhs: Direct(2) }, Store { destination_pointer: Relative(2), source: Relative(7) }, BinaryIntOp { destination: Relative(9), op: Add, bit_size: U32, lhs: Relative(2), rhs: Direct(32837) }, Load { destination: Relative(7), source_pointer: Relative(9) }, Load { destination: Relative(9), source_pointer: Relative(2) }, Const { destination: Relative(10), bit_size: Integer(U32), value: 0 }, BinaryIntOp { destination: Relative(11), op: Equals, bit_size: U32, lhs: Relative(10), rhs: Relative(9) }, Not { destination: Relative(11), source: Relative(11), bit_size: U1 }, JumpIf { condition: Relative(11), location: 94 }, Call { location: 118 }, BinaryIntOp { destination: Relative(9), op: Add, bit_size: U32, lhs: Relative(9), rhs: Direct(2) }, Store { destination_pointer: Relative(2), source: Relative(9) }, Load { destination: Relative(9), source_pointer: Relative(4) }, Mov { destination: Direct(32771), source: Relative(2) }, Const { destination: Direct(32772), bit_size: Integer(U32), value: 3 }, Call { location: 158 }, Mov { destination: Relative(11), source: Direct(32773) }, BinaryIntOp { destination: Relative(12), op: Add, bit_size: U32, lhs: Relative(11), rhs: Direct(32837) }, Store { destination_pointer: Relative(12), source: Relative(5) }, Mov { destination: Direct(32771), source: Relative(11) }, Const { destination: Direct(32772), bit_size: Integer(U32), value: 3 }, Call { location: 158 }, Mov { destination: Relative(2), source: Direct(32773) }, BinaryIntOp { destination: Relative(5), op: Add, bit_size: U32, lhs: Relative(2), rhs: Direct(32836) }, Store { destination_pointer: Relative(5), source: Relative(7) }, Store { destination_pointer: Relative(1), source: Relative(2) }, Store { destination_pointer: Relative(4), source: Relative(9) }, Return, Const { destination: Direct(32772), bit_size: Integer(U32), value: 30720 }, BinaryIntOp { destination: Direct(32771), op: LessThan, bit_size: U32, lhs: Direct(0), rhs: Direct(32772) }, JumpIf { condition: Direct(32771), location: 117 }, IndirectConst { destination_pointer: Direct(1), bit_size: Integer(U64), value: 17843811134343075018 }, Trap { revert_data: HeapVector { pointer: Direct(1), size: Direct(2) } }, Return, IndirectConst { destination_pointer: Direct(1), bit_size: Integer(U64), value: 12049594436772143978 }, Trap { revert_data: HeapVector { pointer: Direct(1), size: Direct(2) } }, Return, Call { location: 112 }, Load { destination: Relative(7), source_pointer: Relative(1) }, Load { destination: Relative(8), source_pointer: Relative(2) }, Load { destination: Relative(9), source_pointer: Relative(7) }, Const { destination: Relative(10), bit_size: Integer(U32), value: 0 }, BinaryIntOp { destination: Relative(11), op: Equals, bit_size: U32, lhs: Relative(10), rhs: Relative(9) }, Not { destination: Relative(11), source: Relative(11), bit_size: U1 }, JumpIf { condition: Relative(11), location: 130 }, Call { location: 118 }, BinaryIntOp { destination: Relative(9), op: Add, bit_size: U32, lhs: Relative(9), rhs: Direct(2) }, Store { destination_pointer: Relative(7), source: Relative(9) }, Mov { destination: Relative(6), source: Direct(32835) }, Jump { location: 134 }, BinaryIntOp { destination: Relative(3), op: LessThan, bit_size: U32, lhs: Relative(6), rhs: Direct(32837) }, JumpIf { condition: Relative(3), location: 138 }, Jump { location: 137 }, Return, BinaryIntOp { destination: Relative(3), op: LessThan, bit_size: U32, lhs: Relative(6), rhs: Relative(5) }, JumpIf { condition: Relative(3), location: 141 }, Jump { location: 155 }, BinaryIntOp { destination: Relative(3), op: Add, bit_size: U32, lhs: Relative(8), rhs: Relative(6) }, BinaryIntOp { destination: Relative(4), op: LessThanEquals, bit_size: U32, lhs: Relative(8), rhs: Relative(3) }, JumpIf { condition: Relative(4), location: 145 }, Call { location: 180 }, Cast { destination: Relative(4), source: Relative(3), bit_size: Field }, Const { destination: Relative(3), bit_size: Integer(U32), value: 9 }, Mov { destination: Relative(9), source: Direct(0) }, Mov { destination: Relative(10), source: Relative(1) }, Mov { destination: Relative(11), source: Relative(2) }, Mov { destination: Relative(12), source: Relative(4) }, BinaryIntOp { destination: Direct(0), op: Add, bit_size: U32, lhs: Direct(0), rhs: Relative(3) }, Call { location: 183 }, Mov { destination: Direct(0), source: Relative(0) }, Jump { location: 155 }, BinaryIntOp { destination: Relative(3), op: Add, bit_size: U32, lhs: Relative(6), rhs: Direct(32836) }, Mov { destination: Relative(6), source: Relative(3) }, Jump { location: 134 }, Load { destination: Direct(32774), source_pointer: Direct(32771) }, BinaryIntOp { destination: Direct(32775), op: Equals, bit_size: U32, lhs: Direct(32774), rhs: Direct(2) }, JumpIf { condition: Direct(32775), location: 162 }, Jump { location: 164 }, Mov { destination: Direct(32773), source: Direct(32771) }, Jump { location: 179 }, Mov { destination: Direct(32773), source: Direct(1) }, BinaryIntOp { destination: Direct(1), op: Add, bit_size: U32, lhs: Direct(1), rhs: Direct(32772) }, BinaryIntOp { destination: Direct(32777), op: Add, bit_size: U32, lhs: Direct(32771), rhs: Direct(32772) }, Mov { destination: Direct(32778), source: Direct(32771) }, Mov { destination: Direct(32779), source: Direct(32773) }, BinaryIntOp { destination: Direct(32780), op: Equals, bit_size: U32, lhs: Direct(32778), rhs: Direct(32777) }, JumpIf { condition: Direct(32780), location: 176 }, Load { destination: Direct(32776), source_pointer: Direct(32778) }, Store { destination_pointer: Direct(32779), source: Direct(32776) }, BinaryIntOp { destination: Direct(32778), op: Add, bit_size: U32, lhs: Direct(32778), rhs: Direct(2) }, BinaryIntOp { destination: Direct(32779), op: Add, bit_size: U32, lhs: Direct(32779), rhs: Direct(2) }, Jump { location: 169 }, IndirectConst { destination_pointer: Direct(32773), bit_size: Integer(U32), value: 1 }, BinaryIntOp { destination: Direct(32774), op: Sub, bit_size: U32, lhs: Direct(32774), rhs: Direct(2) }, Jump { location: 179 }, Return, IndirectConst { destination_pointer: Direct(1), bit_size: Integer(U64), value: 5019202896831570965 }, Trap { revert_data: HeapVector { pointer: Direct(1), size: Direct(2) } }, Return, Call { location: 112 }, Load { destination: Relative(4), source_pointer: Relative(2) }, BinaryIntOp { destination: Relative(5), op: LessThan, bit_size: U32, lhs: Relative(4), rhs: Direct(32837) }, Const { destination: Relative(6), bit_size: Integer(U1), value: 1 }, JumpIf { condition: Relative(5), location: 189 }, Call { location: 204 }, Load { destination: Relative(5), source_pointer: Relative(1) }, Mov { destination: Direct(32771), source: Relative(5) }, Const { destination: Direct(32772), bit_size: Integer(U32), value: 3 }, Call { location: 158 }, Mov { destination: Relative(6), source: Direct(32773) }, BinaryIntOp { destination: Relative(7), op: Add, bit_size: U32, lhs: Relative(6), rhs: Direct(2) }, BinaryIntOp { destination: Relative(8), op: Add, bit_size: U32, lhs: Relative(7), rhs: Relative(4) }, Store { destination_pointer: Relative(8), source: Relative(3) }, BinaryIntOp { destination: Relative(3), op: Add, bit_size: U32, lhs: Relative(4), rhs: Direct(32836) }, BinaryIntOp { destination: Relative(5), op: LessThanEquals, bit_size: U32, lhs: Relative(4), rhs: Relative(3) }, JumpIf { condition: Relative(5), location: 201 }, Call { location: 180 }, Store { destination_pointer: Relative(1), source: Relative(6) }, Store { destination_pointer: Relative(2), source: Relative(3) }, Return, IndirectConst { destination_pointer: Direct(1), bit_size: Integer(U64), value: 5727012404371710682 }, Trap { revert_data: HeapVector { pointer: Direct(1), size: Direct(2) } }, Return]" ], "debug_symbols": "[debug_symbols]", "file_map": "[file_map]", diff --git a/tooling/nargo_cli/tests/snapshots/execution_success/brillig_rc_regression_6123/execute__tests__force_brillig_true_inliner_-9223372036854775808.snap b/tooling/nargo_cli/tests/snapshots/execution_success/brillig_rc_regression_6123/execute__tests__force_brillig_true_inliner_-9223372036854775808.snap index 25c7f6c4c10..70ece965abb 100644 --- a/tooling/nargo_cli/tests/snapshots/execution_success/brillig_rc_regression_6123/execute__tests__force_brillig_true_inliner_-9223372036854775808.snap +++ b/tooling/nargo_cli/tests/snapshots/execution_success/brillig_rc_regression_6123/execute__tests__force_brillig_true_inliner_-9223372036854775808.snap @@ -35,7 +35,7 @@ expression: artifact "return value indices : []", "BRILLIG CALL func 0: inputs: [], outputs: []", "unconstrained func 0", - "[Const { destination: Direct(2), bit_size: Integer(U32), value: 1 }, Const { destination: Direct(1), bit_size: Integer(U32), value: 32838 }, Const { destination: Direct(0), bit_size: Integer(U32), value: 3 }, Const { destination: Relative(1), bit_size: Integer(U32), value: 0 }, Const { destination: Relative(2), bit_size: Integer(U32), value: 0 }, CalldataCopy { destination_address: Direct(32838), size_address: Relative(1), offset_address: Relative(2) }, Call { location: 11 }, Call { location: 15 }, Const { destination: Relative(1), bit_size: Integer(U32), value: 32838 }, Const { destination: Relative(2), bit_size: Integer(U32), value: 0 }, Stop { return_data: HeapVector { pointer: Relative(1), size: Relative(2) } }, Const { destination: Direct(32835), bit_size: Integer(U32), value: 0 }, Const { destination: Direct(32836), bit_size: Integer(U32), value: 1 }, Const { destination: Direct(32837), bit_size: Integer(U32), value: 2 }, Return, Call { location: 66 }, Const { destination: Relative(1), bit_size: Field, value: 0 }, Mov { destination: Relative(2), source: Direct(1) }, Const { destination: Relative(3), bit_size: Integer(U32), value: 3 }, BinaryIntOp { destination: Direct(1), op: Add, bit_size: U32, lhs: Direct(1), rhs: Relative(3) }, IndirectConst { destination_pointer: Relative(2), bit_size: Integer(U32), value: 1 }, BinaryIntOp { destination: Relative(3), op: Add, bit_size: U32, lhs: Relative(2), rhs: Direct(2) }, Mov { destination: Relative(4), source: Relative(3) }, Store { destination_pointer: Relative(4), source: Relative(1) }, BinaryIntOp { destination: Relative(4), op: Add, bit_size: U32, lhs: Relative(4), rhs: Direct(2) }, Store { destination_pointer: Relative(4), source: Relative(1) }, Load { destination: Relative(1), source_pointer: Relative(2) }, Const { destination: Relative(3), bit_size: Integer(U32), value: 0 }, BinaryIntOp { destination: Relative(4), op: Equals, bit_size: U32, lhs: Relative(3), rhs: Relative(1) }, Not { destination: Relative(4), source: Relative(4), bit_size: U1 }, JumpIf { condition: Relative(4), location: 32 }, Call { location: 72 }, BinaryIntOp { destination: Relative(1), op: Add, bit_size: U32, lhs: Relative(1), rhs: Direct(2) }, Store { destination_pointer: Relative(2), source: Relative(1) }, Mov { destination: Relative(1), source: Direct(1) }, BinaryIntOp { destination: Direct(1), op: Add, bit_size: U32, lhs: Direct(1), rhs: Direct(2) }, Store { destination_pointer: Relative(1), source: Relative(2) }, Mov { destination: Relative(4), source: Direct(1) }, BinaryIntOp { destination: Direct(1), op: Add, bit_size: U32, lhs: Direct(1), rhs: Direct(2) }, Store { destination_pointer: Relative(4), source: Direct(32835) }, Mov { destination: Relative(5), source: Direct(1) }, BinaryIntOp { destination: Direct(1), op: Add, bit_size: U32, lhs: Direct(1), rhs: Direct(2) }, Store { destination_pointer: Relative(5), source: Relative(2) }, Mov { destination: Relative(2), source: Direct(1) }, BinaryIntOp { destination: Direct(1), op: Add, bit_size: U32, lhs: Direct(1), rhs: Direct(2) }, Store { destination_pointer: Relative(2), source: Direct(32835) }, Const { destination: Relative(6), bit_size: Integer(U32), value: 7 }, Mov { destination: Relative(7), source: Direct(0) }, Mov { destination: Relative(8), source: Relative(1) }, Mov { destination: Relative(9), source: Relative(4) }, Mov { destination: Relative(10), source: Relative(5) }, Mov { destination: Relative(11), source: Relative(2) }, Mov { destination: Relative(12), source: Direct(32837) }, BinaryIntOp { destination: Direct(0), op: Add, bit_size: U32, lhs: Direct(0), rhs: Relative(6) }, Call { location: 75 }, Mov { destination: Direct(0), source: Relative(0) }, Load { destination: Relative(2), source_pointer: Relative(1) }, Load { destination: Relative(1), source_pointer: Relative(2) }, Const { destination: Relative(4), bit_size: Integer(U32), value: 0 }, BinaryIntOp { destination: Relative(5), op: Equals, bit_size: U32, lhs: Relative(4), rhs: Relative(1) }, Not { destination: Relative(5), source: Relative(5), bit_size: U1 }, JumpIf { condition: Relative(5), location: 63 }, Call { location: 72 }, BinaryIntOp { destination: Relative(1), op: Add, bit_size: U32, lhs: Relative(1), rhs: Direct(2) }, Store { destination_pointer: Relative(2), source: Relative(1) }, Return, Const { destination: Direct(32772), bit_size: Integer(U32), value: 30720 }, BinaryIntOp { destination: Direct(32771), op: LessThan, bit_size: U32, lhs: Direct(0), rhs: Direct(32772) }, JumpIf { condition: Direct(32771), location: 71 }, IndirectConst { destination_pointer: Direct(1), bit_size: Integer(U64), value: 17843811134343075018 }, Trap { revert_data: HeapVector { pointer: Direct(1), size: Direct(2) } }, Return, IndirectConst { destination_pointer: Direct(1), bit_size: Integer(U64), value: 12049594436772143978 }, Trap { revert_data: HeapVector { pointer: Direct(1), size: Direct(2) } }, Return, Call { location: 66 }, Load { destination: Relative(7), source_pointer: Relative(1) }, Load { destination: Relative(8), source_pointer: Relative(2) }, Load { destination: Relative(9), source_pointer: Relative(7) }, Const { destination: Relative(10), bit_size: Integer(U32), value: 0 }, BinaryIntOp { destination: Relative(11), op: Equals, bit_size: U32, lhs: Relative(10), rhs: Relative(9) }, Not { destination: Relative(11), source: Relative(11), bit_size: U1 }, JumpIf { condition: Relative(11), location: 84 }, Call { location: 72 }, BinaryIntOp { destination: Relative(9), op: Add, bit_size: U32, lhs: Relative(9), rhs: Direct(2) }, Store { destination_pointer: Relative(7), source: Relative(9) }, Mov { destination: Relative(6), source: Direct(32835) }, Jump { location: 88 }, BinaryIntOp { destination: Relative(3), op: LessThan, bit_size: U32, lhs: Relative(6), rhs: Direct(32837) }, JumpIf { condition: Relative(3), location: 92 }, Jump { location: 91 }, Return, BinaryIntOp { destination: Relative(3), op: LessThan, bit_size: U32, lhs: Relative(6), rhs: Relative(5) }, JumpIf { condition: Relative(3), location: 95 }, Jump { location: 109 }, BinaryIntOp { destination: Relative(3), op: Add, bit_size: U32, lhs: Relative(8), rhs: Relative(6) }, BinaryIntOp { destination: Relative(4), op: LessThanEquals, bit_size: U32, lhs: Relative(8), rhs: Relative(3) }, JumpIf { condition: Relative(4), location: 99 }, Call { location: 112 }, Cast { destination: Relative(4), source: Relative(3), bit_size: Field }, Const { destination: Relative(3), bit_size: Integer(U32), value: 9 }, Mov { destination: Relative(9), source: Direct(0) }, Mov { destination: Relative(10), source: Relative(1) }, Mov { destination: Relative(11), source: Relative(2) }, Mov { destination: Relative(12), source: Relative(4) }, BinaryIntOp { destination: Direct(0), op: Add, bit_size: U32, lhs: Direct(0), rhs: Relative(3) }, Call { location: 115 }, Mov { destination: Direct(0), source: Relative(0) }, Jump { location: 109 }, BinaryIntOp { destination: Relative(3), op: Add, bit_size: U32, lhs: Relative(6), rhs: Direct(32836) }, Mov { destination: Relative(6), source: Relative(3) }, Jump { location: 88 }, IndirectConst { destination_pointer: Direct(1), bit_size: Integer(U64), value: 5019202896831570965 }, Trap { revert_data: HeapVector { pointer: Direct(1), size: Direct(2) } }, Return, Call { location: 66 }, Load { destination: Relative(4), source_pointer: Relative(2) }, BinaryIntOp { destination: Relative(5), op: LessThan, bit_size: U32, lhs: Relative(4), rhs: Direct(32837) }, Const { destination: Relative(6), bit_size: Integer(U1), value: 1 }, JumpIf { condition: Relative(5), location: 121 }, Call { location: 136 }, Load { destination: Relative(5), source_pointer: Relative(1) }, Mov { destination: Direct(32771), source: Relative(5) }, Const { destination: Direct(32772), bit_size: Integer(U32), value: 3 }, Call { location: 139 }, Mov { destination: Relative(6), source: Direct(32773) }, BinaryIntOp { destination: Relative(7), op: Add, bit_size: U32, lhs: Relative(6), rhs: Direct(2) }, BinaryIntOp { destination: Relative(8), op: Add, bit_size: U32, lhs: Relative(7), rhs: Relative(4) }, Store { destination_pointer: Relative(8), source: Relative(3) }, BinaryIntOp { destination: Relative(3), op: Add, bit_size: U32, lhs: Relative(4), rhs: Direct(32836) }, BinaryIntOp { destination: Relative(5), op: LessThanEquals, bit_size: U32, lhs: Relative(4), rhs: Relative(3) }, JumpIf { condition: Relative(5), location: 133 }, Call { location: 112 }, Store { destination_pointer: Relative(1), source: Relative(6) }, Store { destination_pointer: Relative(2), source: Relative(3) }, Return, IndirectConst { destination_pointer: Direct(1), bit_size: Integer(U64), value: 5727012404371710682 }, Trap { revert_data: HeapVector { pointer: Direct(1), size: Direct(2) } }, Return, Load { destination: Direct(32774), source_pointer: Direct(32771) }, BinaryIntOp { destination: Direct(32775), op: Equals, bit_size: U32, lhs: Direct(32774), rhs: Direct(2) }, JumpIf { condition: Direct(32775), location: 143 }, Jump { location: 145 }, Mov { destination: Direct(32773), source: Direct(32771) }, Jump { location: 160 }, Mov { destination: Direct(32773), source: Direct(1) }, BinaryIntOp { destination: Direct(1), op: Add, bit_size: U32, lhs: Direct(1), rhs: Direct(32772) }, BinaryIntOp { destination: Direct(32777), op: Add, bit_size: U32, lhs: Direct(32771), rhs: Direct(32772) }, Mov { destination: Direct(32778), source: Direct(32771) }, Mov { destination: Direct(32779), source: Direct(32773) }, BinaryIntOp { destination: Direct(32780), op: Equals, bit_size: U32, lhs: Direct(32778), rhs: Direct(32777) }, JumpIf { condition: Direct(32780), location: 157 }, Load { destination: Direct(32776), source_pointer: Direct(32778) }, Store { destination_pointer: Direct(32779), source: Direct(32776) }, BinaryIntOp { destination: Direct(32778), op: Add, bit_size: U32, lhs: Direct(32778), rhs: Direct(2) }, BinaryIntOp { destination: Direct(32779), op: Add, bit_size: U32, lhs: Direct(32779), rhs: Direct(2) }, Jump { location: 150 }, IndirectConst { destination_pointer: Direct(32773), bit_size: Integer(U32), value: 1 }, BinaryIntOp { destination: Direct(32774), op: Sub, bit_size: U32, lhs: Direct(32774), rhs: Direct(2) }, Jump { location: 160 }, Return]" + "[Const { destination: Direct(2), bit_size: Integer(U32), value: 1 }, Const { destination: Direct(1), bit_size: Integer(U32), value: 32838 }, Const { destination: Direct(0), bit_size: Integer(U32), value: 3 }, Const { destination: Relative(1), bit_size: Integer(U32), value: 0 }, Const { destination: Relative(2), bit_size: Integer(U32), value: 0 }, CalldataCopy { destination_address: Direct(32838), size_address: Relative(1), offset_address: Relative(2) }, Call { location: 11 }, Call { location: 15 }, Const { destination: Relative(1), bit_size: Integer(U32), value: 32838 }, Const { destination: Relative(2), bit_size: Integer(U32), value: 0 }, Stop { return_data: HeapVector { pointer: Relative(1), size: Relative(2) } }, Const { destination: Direct(32835), bit_size: Integer(U32), value: 0 }, Const { destination: Direct(32836), bit_size: Integer(U32), value: 1 }, Const { destination: Direct(32837), bit_size: Integer(U32), value: 2 }, Return, Call { location: 112 }, Const { destination: Relative(1), bit_size: Field, value: 0 }, Mov { destination: Relative(2), source: Direct(1) }, Const { destination: Relative(3), bit_size: Integer(U32), value: 3 }, BinaryIntOp { destination: Direct(1), op: Add, bit_size: U32, lhs: Direct(1), rhs: Relative(3) }, IndirectConst { destination_pointer: Relative(2), bit_size: Integer(U32), value: 1 }, BinaryIntOp { destination: Relative(3), op: Add, bit_size: U32, lhs: Relative(2), rhs: Direct(2) }, Mov { destination: Relative(4), source: Relative(3) }, Store { destination_pointer: Relative(4), source: Relative(1) }, BinaryIntOp { destination: Relative(4), op: Add, bit_size: U32, lhs: Relative(4), rhs: Direct(2) }, Store { destination_pointer: Relative(4), source: Relative(1) }, Load { destination: Relative(1), source_pointer: Relative(2) }, Const { destination: Relative(3), bit_size: Integer(U32), value: 0 }, BinaryIntOp { destination: Relative(4), op: Equals, bit_size: U32, lhs: Relative(3), rhs: Relative(1) }, Not { destination: Relative(4), source: Relative(4), bit_size: U1 }, JumpIf { condition: Relative(4), location: 32 }, Call { location: 118 }, BinaryIntOp { destination: Relative(1), op: Add, bit_size: U32, lhs: Relative(1), rhs: Direct(2) }, Store { destination_pointer: Relative(2), source: Relative(1) }, Mov { destination: Relative(1), source: Direct(1) }, BinaryIntOp { destination: Direct(1), op: Add, bit_size: U32, lhs: Direct(1), rhs: Direct(2) }, Store { destination_pointer: Relative(1), source: Relative(2) }, Mov { destination: Relative(4), source: Direct(1) }, BinaryIntOp { destination: Direct(1), op: Add, bit_size: U32, lhs: Direct(1), rhs: Direct(2) }, Store { destination_pointer: Relative(4), source: Direct(32835) }, Mov { destination: Relative(5), source: Direct(1) }, BinaryIntOp { destination: Direct(1), op: Add, bit_size: U32, lhs: Direct(1), rhs: Direct(2) }, Store { destination_pointer: Relative(5), source: Relative(2) }, Mov { destination: Relative(2), source: Direct(1) }, BinaryIntOp { destination: Direct(1), op: Add, bit_size: U32, lhs: Direct(1), rhs: Direct(2) }, Store { destination_pointer: Relative(2), source: Direct(32835) }, Const { destination: Relative(6), bit_size: Integer(U32), value: 7 }, Mov { destination: Relative(7), source: Direct(0) }, Mov { destination: Relative(8), source: Relative(1) }, Mov { destination: Relative(9), source: Relative(4) }, Mov { destination: Relative(10), source: Relative(5) }, Mov { destination: Relative(11), source: Relative(2) }, Mov { destination: Relative(12), source: Direct(32837) }, BinaryIntOp { destination: Direct(0), op: Add, bit_size: U32, lhs: Direct(0), rhs: Relative(6) }, Call { location: 121 }, Mov { destination: Direct(0), source: Relative(0) }, Load { destination: Relative(6), source_pointer: Relative(5) }, Load { destination: Relative(7), source_pointer: Relative(2) }, Const { destination: Relative(8), bit_size: Field, value: 27 }, Mov { destination: Direct(32771), source: Relative(6) }, Const { destination: Direct(32772), bit_size: Integer(U32), value: 3 }, Call { location: 158 }, Mov { destination: Relative(9), source: Direct(32773) }, BinaryIntOp { destination: Relative(10), op: Add, bit_size: U32, lhs: Relative(9), rhs: Direct(32837) }, Store { destination_pointer: Relative(10), source: Relative(8) }, Store { destination_pointer: Relative(5), source: Relative(9) }, Store { destination_pointer: Relative(2), source: Relative(7) }, Load { destination: Relative(2), source_pointer: Relative(1) }, Load { destination: Relative(5), source_pointer: Relative(2) }, Const { destination: Relative(6), bit_size: Integer(U32), value: 0 }, BinaryIntOp { destination: Relative(7), op: Equals, bit_size: U32, lhs: Relative(6), rhs: Relative(5) }, Not { destination: Relative(7), source: Relative(7), bit_size: U1 }, JumpIf { condition: Relative(7), location: 74 }, Call { location: 118 }, BinaryIntOp { destination: Relative(5), op: Add, bit_size: U32, lhs: Relative(5), rhs: Direct(2) }, Store { destination_pointer: Relative(2), source: Relative(5) }, BinaryIntOp { destination: Relative(7), op: Add, bit_size: U32, lhs: Relative(2), rhs: Direct(32836) }, Load { destination: Relative(5), source_pointer: Relative(7) }, Load { destination: Relative(7), source_pointer: Relative(2) }, Const { destination: Relative(8), bit_size: Integer(U32), value: 0 }, BinaryIntOp { destination: Relative(9), op: Equals, bit_size: U32, lhs: Relative(8), rhs: Relative(7) }, Not { destination: Relative(9), source: Relative(9), bit_size: U1 }, JumpIf { condition: Relative(9), location: 84 }, Call { location: 118 }, BinaryIntOp { destination: Relative(7), op: Add, bit_size: U32, lhs: Relative(7), rhs: Direct(2) }, Store { destination_pointer: Relative(2), source: Relative(7) }, BinaryIntOp { destination: Relative(9), op: Add, bit_size: U32, lhs: Relative(2), rhs: Direct(32837) }, Load { destination: Relative(7), source_pointer: Relative(9) }, Load { destination: Relative(9), source_pointer: Relative(2) }, Const { destination: Relative(10), bit_size: Integer(U32), value: 0 }, BinaryIntOp { destination: Relative(11), op: Equals, bit_size: U32, lhs: Relative(10), rhs: Relative(9) }, Not { destination: Relative(11), source: Relative(11), bit_size: U1 }, JumpIf { condition: Relative(11), location: 94 }, Call { location: 118 }, BinaryIntOp { destination: Relative(9), op: Add, bit_size: U32, lhs: Relative(9), rhs: Direct(2) }, Store { destination_pointer: Relative(2), source: Relative(9) }, Load { destination: Relative(9), source_pointer: Relative(4) }, Mov { destination: Direct(32771), source: Relative(2) }, Const { destination: Direct(32772), bit_size: Integer(U32), value: 3 }, Call { location: 158 }, Mov { destination: Relative(11), source: Direct(32773) }, BinaryIntOp { destination: Relative(12), op: Add, bit_size: U32, lhs: Relative(11), rhs: Direct(32837) }, Store { destination_pointer: Relative(12), source: Relative(5) }, Mov { destination: Direct(32771), source: Relative(11) }, Const { destination: Direct(32772), bit_size: Integer(U32), value: 3 }, Call { location: 158 }, Mov { destination: Relative(2), source: Direct(32773) }, BinaryIntOp { destination: Relative(5), op: Add, bit_size: U32, lhs: Relative(2), rhs: Direct(32836) }, Store { destination_pointer: Relative(5), source: Relative(7) }, Store { destination_pointer: Relative(1), source: Relative(2) }, Store { destination_pointer: Relative(4), source: Relative(9) }, Return, Const { destination: Direct(32772), bit_size: Integer(U32), value: 30720 }, BinaryIntOp { destination: Direct(32771), op: LessThan, bit_size: U32, lhs: Direct(0), rhs: Direct(32772) }, JumpIf { condition: Direct(32771), location: 117 }, IndirectConst { destination_pointer: Direct(1), bit_size: Integer(U64), value: 17843811134343075018 }, Trap { revert_data: HeapVector { pointer: Direct(1), size: Direct(2) } }, Return, IndirectConst { destination_pointer: Direct(1), bit_size: Integer(U64), value: 12049594436772143978 }, Trap { revert_data: HeapVector { pointer: Direct(1), size: Direct(2) } }, Return, Call { location: 112 }, Load { destination: Relative(7), source_pointer: Relative(1) }, Load { destination: Relative(8), source_pointer: Relative(2) }, Load { destination: Relative(9), source_pointer: Relative(7) }, Const { destination: Relative(10), bit_size: Integer(U32), value: 0 }, BinaryIntOp { destination: Relative(11), op: Equals, bit_size: U32, lhs: Relative(10), rhs: Relative(9) }, Not { destination: Relative(11), source: Relative(11), bit_size: U1 }, JumpIf { condition: Relative(11), location: 130 }, Call { location: 118 }, BinaryIntOp { destination: Relative(9), op: Add, bit_size: U32, lhs: Relative(9), rhs: Direct(2) }, Store { destination_pointer: Relative(7), source: Relative(9) }, Mov { destination: Relative(6), source: Direct(32835) }, Jump { location: 134 }, BinaryIntOp { destination: Relative(3), op: LessThan, bit_size: U32, lhs: Relative(6), rhs: Direct(32837) }, JumpIf { condition: Relative(3), location: 138 }, Jump { location: 137 }, Return, BinaryIntOp { destination: Relative(3), op: LessThan, bit_size: U32, lhs: Relative(6), rhs: Relative(5) }, JumpIf { condition: Relative(3), location: 141 }, Jump { location: 155 }, BinaryIntOp { destination: Relative(3), op: Add, bit_size: U32, lhs: Relative(8), rhs: Relative(6) }, BinaryIntOp { destination: Relative(4), op: LessThanEquals, bit_size: U32, lhs: Relative(8), rhs: Relative(3) }, JumpIf { condition: Relative(4), location: 145 }, Call { location: 180 }, Cast { destination: Relative(4), source: Relative(3), bit_size: Field }, Const { destination: Relative(3), bit_size: Integer(U32), value: 9 }, Mov { destination: Relative(9), source: Direct(0) }, Mov { destination: Relative(10), source: Relative(1) }, Mov { destination: Relative(11), source: Relative(2) }, Mov { destination: Relative(12), source: Relative(4) }, BinaryIntOp { destination: Direct(0), op: Add, bit_size: U32, lhs: Direct(0), rhs: Relative(3) }, Call { location: 183 }, Mov { destination: Direct(0), source: Relative(0) }, Jump { location: 155 }, BinaryIntOp { destination: Relative(3), op: Add, bit_size: U32, lhs: Relative(6), rhs: Direct(32836) }, Mov { destination: Relative(6), source: Relative(3) }, Jump { location: 134 }, Load { destination: Direct(32774), source_pointer: Direct(32771) }, BinaryIntOp { destination: Direct(32775), op: Equals, bit_size: U32, lhs: Direct(32774), rhs: Direct(2) }, JumpIf { condition: Direct(32775), location: 162 }, Jump { location: 164 }, Mov { destination: Direct(32773), source: Direct(32771) }, Jump { location: 179 }, Mov { destination: Direct(32773), source: Direct(1) }, BinaryIntOp { destination: Direct(1), op: Add, bit_size: U32, lhs: Direct(1), rhs: Direct(32772) }, BinaryIntOp { destination: Direct(32777), op: Add, bit_size: U32, lhs: Direct(32771), rhs: Direct(32772) }, Mov { destination: Direct(32778), source: Direct(32771) }, Mov { destination: Direct(32779), source: Direct(32773) }, BinaryIntOp { destination: Direct(32780), op: Equals, bit_size: U32, lhs: Direct(32778), rhs: Direct(32777) }, JumpIf { condition: Direct(32780), location: 176 }, Load { destination: Direct(32776), source_pointer: Direct(32778) }, Store { destination_pointer: Direct(32779), source: Direct(32776) }, BinaryIntOp { destination: Direct(32778), op: Add, bit_size: U32, lhs: Direct(32778), rhs: Direct(2) }, BinaryIntOp { destination: Direct(32779), op: Add, bit_size: U32, lhs: Direct(32779), rhs: Direct(2) }, Jump { location: 169 }, IndirectConst { destination_pointer: Direct(32773), bit_size: Integer(U32), value: 1 }, BinaryIntOp { destination: Direct(32774), op: Sub, bit_size: U32, lhs: Direct(32774), rhs: Direct(2) }, Jump { location: 179 }, Return, IndirectConst { destination_pointer: Direct(1), bit_size: Integer(U64), value: 5019202896831570965 }, Trap { revert_data: HeapVector { pointer: Direct(1), size: Direct(2) } }, Return, Call { location: 112 }, Load { destination: Relative(4), source_pointer: Relative(2) }, BinaryIntOp { destination: Relative(5), op: LessThan, bit_size: U32, lhs: Relative(4), rhs: Direct(32837) }, Const { destination: Relative(6), bit_size: Integer(U1), value: 1 }, JumpIf { condition: Relative(5), location: 189 }, Call { location: 204 }, Load { destination: Relative(5), source_pointer: Relative(1) }, Mov { destination: Direct(32771), source: Relative(5) }, Const { destination: Direct(32772), bit_size: Integer(U32), value: 3 }, Call { location: 158 }, Mov { destination: Relative(6), source: Direct(32773) }, BinaryIntOp { destination: Relative(7), op: Add, bit_size: U32, lhs: Relative(6), rhs: Direct(2) }, BinaryIntOp { destination: Relative(8), op: Add, bit_size: U32, lhs: Relative(7), rhs: Relative(4) }, Store { destination_pointer: Relative(8), source: Relative(3) }, BinaryIntOp { destination: Relative(3), op: Add, bit_size: U32, lhs: Relative(4), rhs: Direct(32836) }, BinaryIntOp { destination: Relative(5), op: LessThanEquals, bit_size: U32, lhs: Relative(4), rhs: Relative(3) }, JumpIf { condition: Relative(5), location: 201 }, Call { location: 180 }, Store { destination_pointer: Relative(1), source: Relative(6) }, Store { destination_pointer: Relative(2), source: Relative(3) }, Return, IndirectConst { destination_pointer: Direct(1), bit_size: Integer(U64), value: 5727012404371710682 }, Trap { revert_data: HeapVector { pointer: Direct(1), size: Direct(2) } }, Return]" ], "debug_symbols": "[debug_symbols]", "file_map": "[file_map]", diff --git a/tooling/nargo_cli/tests/snapshots/execution_success/regression_9415/execute__tests__force_brillig_false_inliner_-9223372036854775808.snap b/tooling/nargo_cli/tests/snapshots/execution_success/regression_9415/execute__tests__force_brillig_false_inliner_-9223372036854775808.snap index 4b4ddcbdd61..f4d2e6c129b 100644 --- a/tooling/nargo_cli/tests/snapshots/execution_success/regression_9415/execute__tests__force_brillig_false_inliner_-9223372036854775808.snap +++ b/tooling/nargo_cli/tests/snapshots/execution_success/regression_9415/execute__tests__force_brillig_false_inliner_-9223372036854775808.snap @@ -37,7 +37,7 @@ expression: artifact "return value indices : []", "BRILLIG CALL func 0: inputs: [EXPR [ (1, _0) 0 ]], outputs: []", "unconstrained func 0", - "[Const { destination: Direct(2), bit_size: Integer(U32), value: 1 }, Const { destination: Direct(1), bit_size: Integer(U32), value: 32837 }, Const { destination: Direct(0), bit_size: Integer(U32), value: 3 }, Const { destination: Relative(2), bit_size: Integer(U32), value: 1 }, Const { destination: Relative(3), bit_size: Integer(U32), value: 0 }, CalldataCopy { destination_address: Direct(32836), size_address: Relative(2), offset_address: Relative(3) }, Cast { destination: Direct(32836), source: Direct(32836), bit_size: Integer(U32) }, Mov { destination: Relative(1), source: Direct(32836) }, Call { location: 13 }, Call { location: 14 }, Const { destination: Relative(1), bit_size: Integer(U32), value: 32837 }, Const { destination: Relative(2), bit_size: Integer(U32), value: 0 }, Stop { return_data: HeapVector { pointer: Relative(1), size: Relative(2) } }, Return, Call { location: 24 }, Mov { destination: Relative(2), source: Direct(1) }, BinaryIntOp { destination: Direct(1), op: Add, bit_size: U32, lhs: Direct(1), rhs: Direct(2) }, Const { destination: Relative(3), bit_size: Field, value: 2 }, Store { destination_pointer: Relative(2), source: Relative(3) }, Const { destination: Relative(2), bit_size: Integer(U32), value: 0 }, BinaryIntOp { destination: Relative(3), op: Equals, bit_size: U32, lhs: Relative(1), rhs: Relative(2) }, JumpIf { condition: Relative(3), location: 23 }, Call { location: 30 }, Return, Const { destination: Direct(32772), bit_size: Integer(U32), value: 30720 }, BinaryIntOp { destination: Direct(32771), op: LessThan, bit_size: U32, lhs: Direct(0), rhs: Direct(32772) }, JumpIf { condition: Direct(32771), location: 29 }, IndirectConst { destination_pointer: Direct(1), bit_size: Integer(U64), value: 17843811134343075018 }, Trap { revert_data: HeapVector { pointer: Direct(1), size: Direct(2) } }, Return, IndirectConst { destination_pointer: Direct(1), bit_size: Integer(U64), value: 14225679739041873922 }, Trap { revert_data: HeapVector { pointer: Direct(1), size: Direct(2) } }, Return]" + "[Const { destination: Direct(2), bit_size: Integer(U32), value: 1 }, Const { destination: Direct(1), bit_size: Integer(U32), value: 32837 }, Const { destination: Direct(0), bit_size: Integer(U32), value: 3 }, Const { destination: Relative(2), bit_size: Integer(U32), value: 1 }, Const { destination: Relative(3), bit_size: Integer(U32), value: 0 }, CalldataCopy { destination_address: Direct(32836), size_address: Relative(2), offset_address: Relative(3) }, Cast { destination: Direct(32836), source: Direct(32836), bit_size: Integer(U32) }, Mov { destination: Relative(1), source: Direct(32836) }, Call { location: 13 }, Call { location: 14 }, Const { destination: Relative(1), bit_size: Integer(U32), value: 32837 }, Const { destination: Relative(2), bit_size: Integer(U32), value: 0 }, Stop { return_data: HeapVector { pointer: Relative(1), size: Relative(2) } }, Return, Call { location: 20 }, Const { destination: Relative(2), bit_size: Integer(U32), value: 0 }, BinaryIntOp { destination: Relative(3), op: Equals, bit_size: U32, lhs: Relative(1), rhs: Relative(2) }, JumpIf { condition: Relative(3), location: 19 }, Call { location: 26 }, Return, Const { destination: Direct(32772), bit_size: Integer(U32), value: 30720 }, BinaryIntOp { destination: Direct(32771), op: LessThan, bit_size: U32, lhs: Direct(0), rhs: Direct(32772) }, JumpIf { condition: Direct(32771), location: 25 }, IndirectConst { destination_pointer: Direct(1), bit_size: Integer(U64), value: 17843811134343075018 }, Trap { revert_data: HeapVector { pointer: Direct(1), size: Direct(2) } }, Return, IndirectConst { destination_pointer: Direct(1), bit_size: Integer(U64), value: 14225679739041873922 }, Trap { revert_data: HeapVector { pointer: Direct(1), size: Direct(2) } }, Return]" ], "debug_symbols": "[debug_symbols]", "file_map": "[file_map]", diff --git a/tooling/nargo_cli/tests/snapshots/execution_success/regression_9415/execute__tests__force_brillig_false_inliner_0.snap b/tooling/nargo_cli/tests/snapshots/execution_success/regression_9415/execute__tests__force_brillig_false_inliner_0.snap index 4b4ddcbdd61..f4d2e6c129b 100644 --- a/tooling/nargo_cli/tests/snapshots/execution_success/regression_9415/execute__tests__force_brillig_false_inliner_0.snap +++ b/tooling/nargo_cli/tests/snapshots/execution_success/regression_9415/execute__tests__force_brillig_false_inliner_0.snap @@ -37,7 +37,7 @@ expression: artifact "return value indices : []", "BRILLIG CALL func 0: inputs: [EXPR [ (1, _0) 0 ]], outputs: []", "unconstrained func 0", - "[Const { destination: Direct(2), bit_size: Integer(U32), value: 1 }, Const { destination: Direct(1), bit_size: Integer(U32), value: 32837 }, Const { destination: Direct(0), bit_size: Integer(U32), value: 3 }, Const { destination: Relative(2), bit_size: Integer(U32), value: 1 }, Const { destination: Relative(3), bit_size: Integer(U32), value: 0 }, CalldataCopy { destination_address: Direct(32836), size_address: Relative(2), offset_address: Relative(3) }, Cast { destination: Direct(32836), source: Direct(32836), bit_size: Integer(U32) }, Mov { destination: Relative(1), source: Direct(32836) }, Call { location: 13 }, Call { location: 14 }, Const { destination: Relative(1), bit_size: Integer(U32), value: 32837 }, Const { destination: Relative(2), bit_size: Integer(U32), value: 0 }, Stop { return_data: HeapVector { pointer: Relative(1), size: Relative(2) } }, Return, Call { location: 24 }, Mov { destination: Relative(2), source: Direct(1) }, BinaryIntOp { destination: Direct(1), op: Add, bit_size: U32, lhs: Direct(1), rhs: Direct(2) }, Const { destination: Relative(3), bit_size: Field, value: 2 }, Store { destination_pointer: Relative(2), source: Relative(3) }, Const { destination: Relative(2), bit_size: Integer(U32), value: 0 }, BinaryIntOp { destination: Relative(3), op: Equals, bit_size: U32, lhs: Relative(1), rhs: Relative(2) }, JumpIf { condition: Relative(3), location: 23 }, Call { location: 30 }, Return, Const { destination: Direct(32772), bit_size: Integer(U32), value: 30720 }, BinaryIntOp { destination: Direct(32771), op: LessThan, bit_size: U32, lhs: Direct(0), rhs: Direct(32772) }, JumpIf { condition: Direct(32771), location: 29 }, IndirectConst { destination_pointer: Direct(1), bit_size: Integer(U64), value: 17843811134343075018 }, Trap { revert_data: HeapVector { pointer: Direct(1), size: Direct(2) } }, Return, IndirectConst { destination_pointer: Direct(1), bit_size: Integer(U64), value: 14225679739041873922 }, Trap { revert_data: HeapVector { pointer: Direct(1), size: Direct(2) } }, Return]" + "[Const { destination: Direct(2), bit_size: Integer(U32), value: 1 }, Const { destination: Direct(1), bit_size: Integer(U32), value: 32837 }, Const { destination: Direct(0), bit_size: Integer(U32), value: 3 }, Const { destination: Relative(2), bit_size: Integer(U32), value: 1 }, Const { destination: Relative(3), bit_size: Integer(U32), value: 0 }, CalldataCopy { destination_address: Direct(32836), size_address: Relative(2), offset_address: Relative(3) }, Cast { destination: Direct(32836), source: Direct(32836), bit_size: Integer(U32) }, Mov { destination: Relative(1), source: Direct(32836) }, Call { location: 13 }, Call { location: 14 }, Const { destination: Relative(1), bit_size: Integer(U32), value: 32837 }, Const { destination: Relative(2), bit_size: Integer(U32), value: 0 }, Stop { return_data: HeapVector { pointer: Relative(1), size: Relative(2) } }, Return, Call { location: 20 }, Const { destination: Relative(2), bit_size: Integer(U32), value: 0 }, BinaryIntOp { destination: Relative(3), op: Equals, bit_size: U32, lhs: Relative(1), rhs: Relative(2) }, JumpIf { condition: Relative(3), location: 19 }, Call { location: 26 }, Return, Const { destination: Direct(32772), bit_size: Integer(U32), value: 30720 }, BinaryIntOp { destination: Direct(32771), op: LessThan, bit_size: U32, lhs: Direct(0), rhs: Direct(32772) }, JumpIf { condition: Direct(32771), location: 25 }, IndirectConst { destination_pointer: Direct(1), bit_size: Integer(U64), value: 17843811134343075018 }, Trap { revert_data: HeapVector { pointer: Direct(1), size: Direct(2) } }, Return, IndirectConst { destination_pointer: Direct(1), bit_size: Integer(U64), value: 14225679739041873922 }, Trap { revert_data: HeapVector { pointer: Direct(1), size: Direct(2) } }, Return]" ], "debug_symbols": "[debug_symbols]", "file_map": "[file_map]", diff --git a/tooling/nargo_cli/tests/snapshots/execution_success/regression_9415/execute__tests__force_brillig_false_inliner_9223372036854775807.snap b/tooling/nargo_cli/tests/snapshots/execution_success/regression_9415/execute__tests__force_brillig_false_inliner_9223372036854775807.snap index 4b4ddcbdd61..f4d2e6c129b 100644 --- a/tooling/nargo_cli/tests/snapshots/execution_success/regression_9415/execute__tests__force_brillig_false_inliner_9223372036854775807.snap +++ b/tooling/nargo_cli/tests/snapshots/execution_success/regression_9415/execute__tests__force_brillig_false_inliner_9223372036854775807.snap @@ -37,7 +37,7 @@ expression: artifact "return value indices : []", "BRILLIG CALL func 0: inputs: [EXPR [ (1, _0) 0 ]], outputs: []", "unconstrained func 0", - "[Const { destination: Direct(2), bit_size: Integer(U32), value: 1 }, Const { destination: Direct(1), bit_size: Integer(U32), value: 32837 }, Const { destination: Direct(0), bit_size: Integer(U32), value: 3 }, Const { destination: Relative(2), bit_size: Integer(U32), value: 1 }, Const { destination: Relative(3), bit_size: Integer(U32), value: 0 }, CalldataCopy { destination_address: Direct(32836), size_address: Relative(2), offset_address: Relative(3) }, Cast { destination: Direct(32836), source: Direct(32836), bit_size: Integer(U32) }, Mov { destination: Relative(1), source: Direct(32836) }, Call { location: 13 }, Call { location: 14 }, Const { destination: Relative(1), bit_size: Integer(U32), value: 32837 }, Const { destination: Relative(2), bit_size: Integer(U32), value: 0 }, Stop { return_data: HeapVector { pointer: Relative(1), size: Relative(2) } }, Return, Call { location: 24 }, Mov { destination: Relative(2), source: Direct(1) }, BinaryIntOp { destination: Direct(1), op: Add, bit_size: U32, lhs: Direct(1), rhs: Direct(2) }, Const { destination: Relative(3), bit_size: Field, value: 2 }, Store { destination_pointer: Relative(2), source: Relative(3) }, Const { destination: Relative(2), bit_size: Integer(U32), value: 0 }, BinaryIntOp { destination: Relative(3), op: Equals, bit_size: U32, lhs: Relative(1), rhs: Relative(2) }, JumpIf { condition: Relative(3), location: 23 }, Call { location: 30 }, Return, Const { destination: Direct(32772), bit_size: Integer(U32), value: 30720 }, BinaryIntOp { destination: Direct(32771), op: LessThan, bit_size: U32, lhs: Direct(0), rhs: Direct(32772) }, JumpIf { condition: Direct(32771), location: 29 }, IndirectConst { destination_pointer: Direct(1), bit_size: Integer(U64), value: 17843811134343075018 }, Trap { revert_data: HeapVector { pointer: Direct(1), size: Direct(2) } }, Return, IndirectConst { destination_pointer: Direct(1), bit_size: Integer(U64), value: 14225679739041873922 }, Trap { revert_data: HeapVector { pointer: Direct(1), size: Direct(2) } }, Return]" + "[Const { destination: Direct(2), bit_size: Integer(U32), value: 1 }, Const { destination: Direct(1), bit_size: Integer(U32), value: 32837 }, Const { destination: Direct(0), bit_size: Integer(U32), value: 3 }, Const { destination: Relative(2), bit_size: Integer(U32), value: 1 }, Const { destination: Relative(3), bit_size: Integer(U32), value: 0 }, CalldataCopy { destination_address: Direct(32836), size_address: Relative(2), offset_address: Relative(3) }, Cast { destination: Direct(32836), source: Direct(32836), bit_size: Integer(U32) }, Mov { destination: Relative(1), source: Direct(32836) }, Call { location: 13 }, Call { location: 14 }, Const { destination: Relative(1), bit_size: Integer(U32), value: 32837 }, Const { destination: Relative(2), bit_size: Integer(U32), value: 0 }, Stop { return_data: HeapVector { pointer: Relative(1), size: Relative(2) } }, Return, Call { location: 20 }, Const { destination: Relative(2), bit_size: Integer(U32), value: 0 }, BinaryIntOp { destination: Relative(3), op: Equals, bit_size: U32, lhs: Relative(1), rhs: Relative(2) }, JumpIf { condition: Relative(3), location: 19 }, Call { location: 26 }, Return, Const { destination: Direct(32772), bit_size: Integer(U32), value: 30720 }, BinaryIntOp { destination: Direct(32771), op: LessThan, bit_size: U32, lhs: Direct(0), rhs: Direct(32772) }, JumpIf { condition: Direct(32771), location: 25 }, IndirectConst { destination_pointer: Direct(1), bit_size: Integer(U64), value: 17843811134343075018 }, Trap { revert_data: HeapVector { pointer: Direct(1), size: Direct(2) } }, Return, IndirectConst { destination_pointer: Direct(1), bit_size: Integer(U64), value: 14225679739041873922 }, Trap { revert_data: HeapVector { pointer: Direct(1), size: Direct(2) } }, Return]" ], "debug_symbols": "[debug_symbols]", "file_map": "[file_map]", diff --git a/tooling/nargo_cli/tests/snapshots/execution_success/regression_9415/execute__tests__force_brillig_true_inliner_-9223372036854775808.snap b/tooling/nargo_cli/tests/snapshots/execution_success/regression_9415/execute__tests__force_brillig_true_inliner_-9223372036854775808.snap index 4b4ddcbdd61..f4d2e6c129b 100644 --- a/tooling/nargo_cli/tests/snapshots/execution_success/regression_9415/execute__tests__force_brillig_true_inliner_-9223372036854775808.snap +++ b/tooling/nargo_cli/tests/snapshots/execution_success/regression_9415/execute__tests__force_brillig_true_inliner_-9223372036854775808.snap @@ -37,7 +37,7 @@ expression: artifact "return value indices : []", "BRILLIG CALL func 0: inputs: [EXPR [ (1, _0) 0 ]], outputs: []", "unconstrained func 0", - "[Const { destination: Direct(2), bit_size: Integer(U32), value: 1 }, Const { destination: Direct(1), bit_size: Integer(U32), value: 32837 }, Const { destination: Direct(0), bit_size: Integer(U32), value: 3 }, Const { destination: Relative(2), bit_size: Integer(U32), value: 1 }, Const { destination: Relative(3), bit_size: Integer(U32), value: 0 }, CalldataCopy { destination_address: Direct(32836), size_address: Relative(2), offset_address: Relative(3) }, Cast { destination: Direct(32836), source: Direct(32836), bit_size: Integer(U32) }, Mov { destination: Relative(1), source: Direct(32836) }, Call { location: 13 }, Call { location: 14 }, Const { destination: Relative(1), bit_size: Integer(U32), value: 32837 }, Const { destination: Relative(2), bit_size: Integer(U32), value: 0 }, Stop { return_data: HeapVector { pointer: Relative(1), size: Relative(2) } }, Return, Call { location: 24 }, Mov { destination: Relative(2), source: Direct(1) }, BinaryIntOp { destination: Direct(1), op: Add, bit_size: U32, lhs: Direct(1), rhs: Direct(2) }, Const { destination: Relative(3), bit_size: Field, value: 2 }, Store { destination_pointer: Relative(2), source: Relative(3) }, Const { destination: Relative(2), bit_size: Integer(U32), value: 0 }, BinaryIntOp { destination: Relative(3), op: Equals, bit_size: U32, lhs: Relative(1), rhs: Relative(2) }, JumpIf { condition: Relative(3), location: 23 }, Call { location: 30 }, Return, Const { destination: Direct(32772), bit_size: Integer(U32), value: 30720 }, BinaryIntOp { destination: Direct(32771), op: LessThan, bit_size: U32, lhs: Direct(0), rhs: Direct(32772) }, JumpIf { condition: Direct(32771), location: 29 }, IndirectConst { destination_pointer: Direct(1), bit_size: Integer(U64), value: 17843811134343075018 }, Trap { revert_data: HeapVector { pointer: Direct(1), size: Direct(2) } }, Return, IndirectConst { destination_pointer: Direct(1), bit_size: Integer(U64), value: 14225679739041873922 }, Trap { revert_data: HeapVector { pointer: Direct(1), size: Direct(2) } }, Return]" + "[Const { destination: Direct(2), bit_size: Integer(U32), value: 1 }, Const { destination: Direct(1), bit_size: Integer(U32), value: 32837 }, Const { destination: Direct(0), bit_size: Integer(U32), value: 3 }, Const { destination: Relative(2), bit_size: Integer(U32), value: 1 }, Const { destination: Relative(3), bit_size: Integer(U32), value: 0 }, CalldataCopy { destination_address: Direct(32836), size_address: Relative(2), offset_address: Relative(3) }, Cast { destination: Direct(32836), source: Direct(32836), bit_size: Integer(U32) }, Mov { destination: Relative(1), source: Direct(32836) }, Call { location: 13 }, Call { location: 14 }, Const { destination: Relative(1), bit_size: Integer(U32), value: 32837 }, Const { destination: Relative(2), bit_size: Integer(U32), value: 0 }, Stop { return_data: HeapVector { pointer: Relative(1), size: Relative(2) } }, Return, Call { location: 20 }, Const { destination: Relative(2), bit_size: Integer(U32), value: 0 }, BinaryIntOp { destination: Relative(3), op: Equals, bit_size: U32, lhs: Relative(1), rhs: Relative(2) }, JumpIf { condition: Relative(3), location: 19 }, Call { location: 26 }, Return, Const { destination: Direct(32772), bit_size: Integer(U32), value: 30720 }, BinaryIntOp { destination: Direct(32771), op: LessThan, bit_size: U32, lhs: Direct(0), rhs: Direct(32772) }, JumpIf { condition: Direct(32771), location: 25 }, IndirectConst { destination_pointer: Direct(1), bit_size: Integer(U64), value: 17843811134343075018 }, Trap { revert_data: HeapVector { pointer: Direct(1), size: Direct(2) } }, Return, IndirectConst { destination_pointer: Direct(1), bit_size: Integer(U64), value: 14225679739041873922 }, Trap { revert_data: HeapVector { pointer: Direct(1), size: Direct(2) } }, Return]" ], "debug_symbols": "[debug_symbols]", "file_map": "[file_map]", diff --git a/tooling/nargo_cli/tests/snapshots/execution_success/regression_9415/execute__tests__force_brillig_true_inliner_0.snap b/tooling/nargo_cli/tests/snapshots/execution_success/regression_9415/execute__tests__force_brillig_true_inliner_0.snap index 4b4ddcbdd61..f4d2e6c129b 100644 --- a/tooling/nargo_cli/tests/snapshots/execution_success/regression_9415/execute__tests__force_brillig_true_inliner_0.snap +++ b/tooling/nargo_cli/tests/snapshots/execution_success/regression_9415/execute__tests__force_brillig_true_inliner_0.snap @@ -37,7 +37,7 @@ expression: artifact "return value indices : []", "BRILLIG CALL func 0: inputs: [EXPR [ (1, _0) 0 ]], outputs: []", "unconstrained func 0", - "[Const { destination: Direct(2), bit_size: Integer(U32), value: 1 }, Const { destination: Direct(1), bit_size: Integer(U32), value: 32837 }, Const { destination: Direct(0), bit_size: Integer(U32), value: 3 }, Const { destination: Relative(2), bit_size: Integer(U32), value: 1 }, Const { destination: Relative(3), bit_size: Integer(U32), value: 0 }, CalldataCopy { destination_address: Direct(32836), size_address: Relative(2), offset_address: Relative(3) }, Cast { destination: Direct(32836), source: Direct(32836), bit_size: Integer(U32) }, Mov { destination: Relative(1), source: Direct(32836) }, Call { location: 13 }, Call { location: 14 }, Const { destination: Relative(1), bit_size: Integer(U32), value: 32837 }, Const { destination: Relative(2), bit_size: Integer(U32), value: 0 }, Stop { return_data: HeapVector { pointer: Relative(1), size: Relative(2) } }, Return, Call { location: 24 }, Mov { destination: Relative(2), source: Direct(1) }, BinaryIntOp { destination: Direct(1), op: Add, bit_size: U32, lhs: Direct(1), rhs: Direct(2) }, Const { destination: Relative(3), bit_size: Field, value: 2 }, Store { destination_pointer: Relative(2), source: Relative(3) }, Const { destination: Relative(2), bit_size: Integer(U32), value: 0 }, BinaryIntOp { destination: Relative(3), op: Equals, bit_size: U32, lhs: Relative(1), rhs: Relative(2) }, JumpIf { condition: Relative(3), location: 23 }, Call { location: 30 }, Return, Const { destination: Direct(32772), bit_size: Integer(U32), value: 30720 }, BinaryIntOp { destination: Direct(32771), op: LessThan, bit_size: U32, lhs: Direct(0), rhs: Direct(32772) }, JumpIf { condition: Direct(32771), location: 29 }, IndirectConst { destination_pointer: Direct(1), bit_size: Integer(U64), value: 17843811134343075018 }, Trap { revert_data: HeapVector { pointer: Direct(1), size: Direct(2) } }, Return, IndirectConst { destination_pointer: Direct(1), bit_size: Integer(U64), value: 14225679739041873922 }, Trap { revert_data: HeapVector { pointer: Direct(1), size: Direct(2) } }, Return]" + "[Const { destination: Direct(2), bit_size: Integer(U32), value: 1 }, Const { destination: Direct(1), bit_size: Integer(U32), value: 32837 }, Const { destination: Direct(0), bit_size: Integer(U32), value: 3 }, Const { destination: Relative(2), bit_size: Integer(U32), value: 1 }, Const { destination: Relative(3), bit_size: Integer(U32), value: 0 }, CalldataCopy { destination_address: Direct(32836), size_address: Relative(2), offset_address: Relative(3) }, Cast { destination: Direct(32836), source: Direct(32836), bit_size: Integer(U32) }, Mov { destination: Relative(1), source: Direct(32836) }, Call { location: 13 }, Call { location: 14 }, Const { destination: Relative(1), bit_size: Integer(U32), value: 32837 }, Const { destination: Relative(2), bit_size: Integer(U32), value: 0 }, Stop { return_data: HeapVector { pointer: Relative(1), size: Relative(2) } }, Return, Call { location: 20 }, Const { destination: Relative(2), bit_size: Integer(U32), value: 0 }, BinaryIntOp { destination: Relative(3), op: Equals, bit_size: U32, lhs: Relative(1), rhs: Relative(2) }, JumpIf { condition: Relative(3), location: 19 }, Call { location: 26 }, Return, Const { destination: Direct(32772), bit_size: Integer(U32), value: 30720 }, BinaryIntOp { destination: Direct(32771), op: LessThan, bit_size: U32, lhs: Direct(0), rhs: Direct(32772) }, JumpIf { condition: Direct(32771), location: 25 }, IndirectConst { destination_pointer: Direct(1), bit_size: Integer(U64), value: 17843811134343075018 }, Trap { revert_data: HeapVector { pointer: Direct(1), size: Direct(2) } }, Return, IndirectConst { destination_pointer: Direct(1), bit_size: Integer(U64), value: 14225679739041873922 }, Trap { revert_data: HeapVector { pointer: Direct(1), size: Direct(2) } }, Return]" ], "debug_symbols": "[debug_symbols]", "file_map": "[file_map]", diff --git a/tooling/nargo_cli/tests/snapshots/execution_success/regression_9415/execute__tests__force_brillig_true_inliner_9223372036854775807.snap b/tooling/nargo_cli/tests/snapshots/execution_success/regression_9415/execute__tests__force_brillig_true_inliner_9223372036854775807.snap index 4b4ddcbdd61..f4d2e6c129b 100644 --- a/tooling/nargo_cli/tests/snapshots/execution_success/regression_9415/execute__tests__force_brillig_true_inliner_9223372036854775807.snap +++ b/tooling/nargo_cli/tests/snapshots/execution_success/regression_9415/execute__tests__force_brillig_true_inliner_9223372036854775807.snap @@ -37,7 +37,7 @@ expression: artifact "return value indices : []", "BRILLIG CALL func 0: inputs: [EXPR [ (1, _0) 0 ]], outputs: []", "unconstrained func 0", - "[Const { destination: Direct(2), bit_size: Integer(U32), value: 1 }, Const { destination: Direct(1), bit_size: Integer(U32), value: 32837 }, Const { destination: Direct(0), bit_size: Integer(U32), value: 3 }, Const { destination: Relative(2), bit_size: Integer(U32), value: 1 }, Const { destination: Relative(3), bit_size: Integer(U32), value: 0 }, CalldataCopy { destination_address: Direct(32836), size_address: Relative(2), offset_address: Relative(3) }, Cast { destination: Direct(32836), source: Direct(32836), bit_size: Integer(U32) }, Mov { destination: Relative(1), source: Direct(32836) }, Call { location: 13 }, Call { location: 14 }, Const { destination: Relative(1), bit_size: Integer(U32), value: 32837 }, Const { destination: Relative(2), bit_size: Integer(U32), value: 0 }, Stop { return_data: HeapVector { pointer: Relative(1), size: Relative(2) } }, Return, Call { location: 24 }, Mov { destination: Relative(2), source: Direct(1) }, BinaryIntOp { destination: Direct(1), op: Add, bit_size: U32, lhs: Direct(1), rhs: Direct(2) }, Const { destination: Relative(3), bit_size: Field, value: 2 }, Store { destination_pointer: Relative(2), source: Relative(3) }, Const { destination: Relative(2), bit_size: Integer(U32), value: 0 }, BinaryIntOp { destination: Relative(3), op: Equals, bit_size: U32, lhs: Relative(1), rhs: Relative(2) }, JumpIf { condition: Relative(3), location: 23 }, Call { location: 30 }, Return, Const { destination: Direct(32772), bit_size: Integer(U32), value: 30720 }, BinaryIntOp { destination: Direct(32771), op: LessThan, bit_size: U32, lhs: Direct(0), rhs: Direct(32772) }, JumpIf { condition: Direct(32771), location: 29 }, IndirectConst { destination_pointer: Direct(1), bit_size: Integer(U64), value: 17843811134343075018 }, Trap { revert_data: HeapVector { pointer: Direct(1), size: Direct(2) } }, Return, IndirectConst { destination_pointer: Direct(1), bit_size: Integer(U64), value: 14225679739041873922 }, Trap { revert_data: HeapVector { pointer: Direct(1), size: Direct(2) } }, Return]" + "[Const { destination: Direct(2), bit_size: Integer(U32), value: 1 }, Const { destination: Direct(1), bit_size: Integer(U32), value: 32837 }, Const { destination: Direct(0), bit_size: Integer(U32), value: 3 }, Const { destination: Relative(2), bit_size: Integer(U32), value: 1 }, Const { destination: Relative(3), bit_size: Integer(U32), value: 0 }, CalldataCopy { destination_address: Direct(32836), size_address: Relative(2), offset_address: Relative(3) }, Cast { destination: Direct(32836), source: Direct(32836), bit_size: Integer(U32) }, Mov { destination: Relative(1), source: Direct(32836) }, Call { location: 13 }, Call { location: 14 }, Const { destination: Relative(1), bit_size: Integer(U32), value: 32837 }, Const { destination: Relative(2), bit_size: Integer(U32), value: 0 }, Stop { return_data: HeapVector { pointer: Relative(1), size: Relative(2) } }, Return, Call { location: 20 }, Const { destination: Relative(2), bit_size: Integer(U32), value: 0 }, BinaryIntOp { destination: Relative(3), op: Equals, bit_size: U32, lhs: Relative(1), rhs: Relative(2) }, JumpIf { condition: Relative(3), location: 19 }, Call { location: 26 }, Return, Const { destination: Direct(32772), bit_size: Integer(U32), value: 30720 }, BinaryIntOp { destination: Direct(32771), op: LessThan, bit_size: U32, lhs: Direct(0), rhs: Direct(32772) }, JumpIf { condition: Direct(32771), location: 25 }, IndirectConst { destination_pointer: Direct(1), bit_size: Integer(U64), value: 17843811134343075018 }, Trap { revert_data: HeapVector { pointer: Direct(1), size: Direct(2) } }, Return, IndirectConst { destination_pointer: Direct(1), bit_size: Integer(U64), value: 14225679739041873922 }, Trap { revert_data: HeapVector { pointer: Direct(1), size: Direct(2) } }, Return]" ], "debug_symbols": "[debug_symbols]", "file_map": "[file_map]", diff --git a/tooling/nargo_cli/tests/snapshots/execution_success/regression_9657/execute__tests__expanded.snap b/tooling/nargo_cli/tests/snapshots/execution_success/regression_9657/execute__tests__expanded.snap new file mode 100644 index 00000000000..dd6479f585f --- /dev/null +++ b/tooling/nargo_cli/tests/snapshots/execution_success/regression_9657/execute__tests__expanded.snap @@ -0,0 +1,18 @@ +--- +source: tooling/nargo_cli/tests/execute.rs +expression: expanded_code +--- +unconstrained fn main(v2: u32) { + let v0: &mut Field = &mut 0_Field; + let v7: Field = foo(v0, v0, v2); + assert(v7 == 100_Field); +} + +unconstrained fn foo(v0: &mut Field, v1: &mut Field, v2: u32) -> Field { + let mut v3: [&mut Field; 1] = [v0]; + v3[v2] = v1; + let _v5: Field = *v0; + let v6: &mut Field = v3[v2]; + *v6 = 100_Field; + *v0 +} diff --git a/tooling/nargo_cli/tests/snapshots/execution_success/regression_9657/execute__tests__force_brillig_false_inliner_-9223372036854775808.snap b/tooling/nargo_cli/tests/snapshots/execution_success/regression_9657/execute__tests__force_brillig_false_inliner_-9223372036854775808.snap new file mode 100644 index 00000000000..30fb489d3db --- /dev/null +++ b/tooling/nargo_cli/tests/snapshots/execution_success/regression_9657/execute__tests__force_brillig_false_inliner_-9223372036854775808.snap @@ -0,0 +1,50 @@ +--- +source: tooling/nargo_cli/tests/execute.rs +expression: artifact +--- +{ + "noir_version": "[noir_version]", + "hash": "[hash]", + "abi": { + "parameters": [ + { + "name": "v2", + "type": { + "kind": "integer", + "sign": "unsigned", + "width": 32 + }, + "visibility": "private" + } + ], + "return_type": null, + "error_types": { + "14225679739041873922": { + "error_kind": "string", + "string": "Index out of bounds" + }, + "17843811134343075018": { + "error_kind": "string", + "string": "Stack too deep" + } + } + }, + "bytecode": [ + "func 0", + "current witness index : _0", + "private parameters indices : [_0]", + "public parameters indices : []", + "return value indices : []", + "BRILLIG CALL func 0: inputs: [EXPR [ (1, _0) 0 ]], outputs: []", + "unconstrained func 0", + "[Const { destination: Direct(2), bit_size: Integer(U32), value: 1 }, Const { destination: Direct(1), bit_size: Integer(U32), value: 32837 }, Const { destination: Direct(0), bit_size: Integer(U32), value: 3 }, Const { destination: Relative(2), bit_size: Integer(U32), value: 1 }, Const { destination: Relative(3), bit_size: Integer(U32), value: 0 }, CalldataCopy { destination_address: Direct(32836), size_address: Relative(2), offset_address: Relative(3) }, Cast { destination: Direct(32836), source: Direct(32836), bit_size: Integer(U32) }, Mov { destination: Relative(1), source: Direct(32836) }, Call { location: 13 }, Call { location: 15 }, Const { destination: Relative(1), bit_size: Integer(U32), value: 32837 }, Const { destination: Relative(2), bit_size: Integer(U32), value: 0 }, Stop { return_data: HeapVector { pointer: Relative(1), size: Relative(2) } }, Const { destination: Direct(32835), bit_size: Field, value: 100 }, Return, Call { location: 34 }, Mov { destination: Relative(2), source: Direct(1) }, BinaryIntOp { destination: Direct(1), op: Add, bit_size: U32, lhs: Direct(1), rhs: Direct(2) }, Const { destination: Relative(3), bit_size: Field, value: 0 }, Store { destination_pointer: Relative(2), source: Relative(3) }, Const { destination: Relative(4), bit_size: Integer(U32), value: 5 }, Mov { destination: Relative(5), source: Direct(0) }, Mov { destination: Relative(6), source: Relative(2) }, Mov { destination: Relative(7), source: Relative(2) }, Mov { destination: Relative(8), source: Relative(1) }, BinaryIntOp { destination: Direct(0), op: Add, bit_size: U32, lhs: Direct(0), rhs: Relative(4) }, Call { location: 40 }, Mov { destination: Direct(0), source: Relative(0) }, Mov { destination: Relative(3), source: Relative(6) }, BinaryFieldOp { destination: Relative(1), op: Equals, lhs: Relative(3), rhs: Direct(32835) }, JumpIf { condition: Relative(1), location: 33 }, Const { destination: Relative(2), bit_size: Integer(U32), value: 0 }, Trap { revert_data: HeapVector { pointer: Direct(1), size: Relative(2) } }, Return, Const { destination: Direct(32772), bit_size: Integer(U32), value: 30720 }, BinaryIntOp { destination: Direct(32771), op: LessThan, bit_size: U32, lhs: Direct(0), rhs: Direct(32772) }, JumpIf { condition: Direct(32771), location: 39 }, IndirectConst { destination_pointer: Direct(1), bit_size: Integer(U64), value: 17843811134343075018 }, Trap { revert_data: HeapVector { pointer: Direct(1), size: Direct(2) } }, Return, Call { location: 34 }, Const { destination: Relative(4), bit_size: Integer(U32), value: 0 }, BinaryIntOp { destination: Relative(5), op: Equals, bit_size: U32, lhs: Relative(3), rhs: Relative(4) }, JumpIf { condition: Relative(5), location: 45 }, Call { location: 49 }, Store { destination_pointer: Relative(2), source: Direct(32835) }, Load { destination: Relative(2), source_pointer: Relative(1) }, Mov { destination: Relative(1), source: Relative(2) }, Return, IndirectConst { destination_pointer: Direct(1), bit_size: Integer(U64), value: 14225679739041873922 }, Trap { revert_data: HeapVector { pointer: Direct(1), size: Direct(2) } }, Return]" + ], + "debug_symbols": "[debug_symbols]", + "file_map": "[file_map]", + "names": [ + "main" + ], + "brillig_names": [ + "main" + ] +} diff --git a/tooling/nargo_cli/tests/snapshots/execution_success/regression_9657/execute__tests__force_brillig_false_inliner_0.snap b/tooling/nargo_cli/tests/snapshots/execution_success/regression_9657/execute__tests__force_brillig_false_inliner_0.snap new file mode 100644 index 00000000000..57df28848ba --- /dev/null +++ b/tooling/nargo_cli/tests/snapshots/execution_success/regression_9657/execute__tests__force_brillig_false_inliner_0.snap @@ -0,0 +1,50 @@ +--- +source: tooling/nargo_cli/tests/execute.rs +expression: artifact +--- +{ + "noir_version": "[noir_version]", + "hash": "[hash]", + "abi": { + "parameters": [ + { + "name": "v2", + "type": { + "kind": "integer", + "sign": "unsigned", + "width": 32 + }, + "visibility": "private" + } + ], + "return_type": null, + "error_types": { + "14225679739041873922": { + "error_kind": "string", + "string": "Index out of bounds" + }, + "17843811134343075018": { + "error_kind": "string", + "string": "Stack too deep" + } + } + }, + "bytecode": [ + "func 0", + "current witness index : _0", + "private parameters indices : [_0]", + "public parameters indices : []", + "return value indices : []", + "BRILLIG CALL func 0: inputs: [EXPR [ (1, _0) 0 ]], outputs: []", + "unconstrained func 0", + "[Const { destination: Direct(2), bit_size: Integer(U32), value: 1 }, Const { destination: Direct(1), bit_size: Integer(U32), value: 32837 }, Const { destination: Direct(0), bit_size: Integer(U32), value: 3 }, Const { destination: Relative(2), bit_size: Integer(U32), value: 1 }, Const { destination: Relative(3), bit_size: Integer(U32), value: 0 }, CalldataCopy { destination_address: Direct(32836), size_address: Relative(2), offset_address: Relative(3) }, Cast { destination: Direct(32836), source: Direct(32836), bit_size: Integer(U32) }, Mov { destination: Relative(1), source: Direct(32836) }, Call { location: 13 }, Call { location: 14 }, Const { destination: Relative(1), bit_size: Integer(U32), value: 32837 }, Const { destination: Relative(2), bit_size: Integer(U32), value: 0 }, Stop { return_data: HeapVector { pointer: Relative(1), size: Relative(2) } }, Return, Call { location: 20 }, Const { destination: Relative(2), bit_size: Integer(U32), value: 0 }, BinaryIntOp { destination: Relative(3), op: Equals, bit_size: U32, lhs: Relative(1), rhs: Relative(2) }, JumpIf { condition: Relative(3), location: 19 }, Call { location: 26 }, Return, Const { destination: Direct(32772), bit_size: Integer(U32), value: 30720 }, BinaryIntOp { destination: Direct(32771), op: LessThan, bit_size: U32, lhs: Direct(0), rhs: Direct(32772) }, JumpIf { condition: Direct(32771), location: 25 }, IndirectConst { destination_pointer: Direct(1), bit_size: Integer(U64), value: 17843811134343075018 }, Trap { revert_data: HeapVector { pointer: Direct(1), size: Direct(2) } }, Return, IndirectConst { destination_pointer: Direct(1), bit_size: Integer(U64), value: 14225679739041873922 }, Trap { revert_data: HeapVector { pointer: Direct(1), size: Direct(2) } }, Return]" + ], + "debug_symbols": "[debug_symbols]", + "file_map": "[file_map]", + "names": [ + "main" + ], + "brillig_names": [ + "main" + ] +} diff --git a/tooling/nargo_cli/tests/snapshots/execution_success/regression_9657/execute__tests__force_brillig_false_inliner_9223372036854775807.snap b/tooling/nargo_cli/tests/snapshots/execution_success/regression_9657/execute__tests__force_brillig_false_inliner_9223372036854775807.snap new file mode 100644 index 00000000000..57df28848ba --- /dev/null +++ b/tooling/nargo_cli/tests/snapshots/execution_success/regression_9657/execute__tests__force_brillig_false_inliner_9223372036854775807.snap @@ -0,0 +1,50 @@ +--- +source: tooling/nargo_cli/tests/execute.rs +expression: artifact +--- +{ + "noir_version": "[noir_version]", + "hash": "[hash]", + "abi": { + "parameters": [ + { + "name": "v2", + "type": { + "kind": "integer", + "sign": "unsigned", + "width": 32 + }, + "visibility": "private" + } + ], + "return_type": null, + "error_types": { + "14225679739041873922": { + "error_kind": "string", + "string": "Index out of bounds" + }, + "17843811134343075018": { + "error_kind": "string", + "string": "Stack too deep" + } + } + }, + "bytecode": [ + "func 0", + "current witness index : _0", + "private parameters indices : [_0]", + "public parameters indices : []", + "return value indices : []", + "BRILLIG CALL func 0: inputs: [EXPR [ (1, _0) 0 ]], outputs: []", + "unconstrained func 0", + "[Const { destination: Direct(2), bit_size: Integer(U32), value: 1 }, Const { destination: Direct(1), bit_size: Integer(U32), value: 32837 }, Const { destination: Direct(0), bit_size: Integer(U32), value: 3 }, Const { destination: Relative(2), bit_size: Integer(U32), value: 1 }, Const { destination: Relative(3), bit_size: Integer(U32), value: 0 }, CalldataCopy { destination_address: Direct(32836), size_address: Relative(2), offset_address: Relative(3) }, Cast { destination: Direct(32836), source: Direct(32836), bit_size: Integer(U32) }, Mov { destination: Relative(1), source: Direct(32836) }, Call { location: 13 }, Call { location: 14 }, Const { destination: Relative(1), bit_size: Integer(U32), value: 32837 }, Const { destination: Relative(2), bit_size: Integer(U32), value: 0 }, Stop { return_data: HeapVector { pointer: Relative(1), size: Relative(2) } }, Return, Call { location: 20 }, Const { destination: Relative(2), bit_size: Integer(U32), value: 0 }, BinaryIntOp { destination: Relative(3), op: Equals, bit_size: U32, lhs: Relative(1), rhs: Relative(2) }, JumpIf { condition: Relative(3), location: 19 }, Call { location: 26 }, Return, Const { destination: Direct(32772), bit_size: Integer(U32), value: 30720 }, BinaryIntOp { destination: Direct(32771), op: LessThan, bit_size: U32, lhs: Direct(0), rhs: Direct(32772) }, JumpIf { condition: Direct(32771), location: 25 }, IndirectConst { destination_pointer: Direct(1), bit_size: Integer(U64), value: 17843811134343075018 }, Trap { revert_data: HeapVector { pointer: Direct(1), size: Direct(2) } }, Return, IndirectConst { destination_pointer: Direct(1), bit_size: Integer(U64), value: 14225679739041873922 }, Trap { revert_data: HeapVector { pointer: Direct(1), size: Direct(2) } }, Return]" + ], + "debug_symbols": "[debug_symbols]", + "file_map": "[file_map]", + "names": [ + "main" + ], + "brillig_names": [ + "main" + ] +} diff --git a/tooling/nargo_cli/tests/snapshots/execution_success/regression_9657/execute__tests__force_brillig_true_inliner_-9223372036854775808.snap b/tooling/nargo_cli/tests/snapshots/execution_success/regression_9657/execute__tests__force_brillig_true_inliner_-9223372036854775808.snap new file mode 100644 index 00000000000..30fb489d3db --- /dev/null +++ b/tooling/nargo_cli/tests/snapshots/execution_success/regression_9657/execute__tests__force_brillig_true_inliner_-9223372036854775808.snap @@ -0,0 +1,50 @@ +--- +source: tooling/nargo_cli/tests/execute.rs +expression: artifact +--- +{ + "noir_version": "[noir_version]", + "hash": "[hash]", + "abi": { + "parameters": [ + { + "name": "v2", + "type": { + "kind": "integer", + "sign": "unsigned", + "width": 32 + }, + "visibility": "private" + } + ], + "return_type": null, + "error_types": { + "14225679739041873922": { + "error_kind": "string", + "string": "Index out of bounds" + }, + "17843811134343075018": { + "error_kind": "string", + "string": "Stack too deep" + } + } + }, + "bytecode": [ + "func 0", + "current witness index : _0", + "private parameters indices : [_0]", + "public parameters indices : []", + "return value indices : []", + "BRILLIG CALL func 0: inputs: [EXPR [ (1, _0) 0 ]], outputs: []", + "unconstrained func 0", + "[Const { destination: Direct(2), bit_size: Integer(U32), value: 1 }, Const { destination: Direct(1), bit_size: Integer(U32), value: 32837 }, Const { destination: Direct(0), bit_size: Integer(U32), value: 3 }, Const { destination: Relative(2), bit_size: Integer(U32), value: 1 }, Const { destination: Relative(3), bit_size: Integer(U32), value: 0 }, CalldataCopy { destination_address: Direct(32836), size_address: Relative(2), offset_address: Relative(3) }, Cast { destination: Direct(32836), source: Direct(32836), bit_size: Integer(U32) }, Mov { destination: Relative(1), source: Direct(32836) }, Call { location: 13 }, Call { location: 15 }, Const { destination: Relative(1), bit_size: Integer(U32), value: 32837 }, Const { destination: Relative(2), bit_size: Integer(U32), value: 0 }, Stop { return_data: HeapVector { pointer: Relative(1), size: Relative(2) } }, Const { destination: Direct(32835), bit_size: Field, value: 100 }, Return, Call { location: 34 }, Mov { destination: Relative(2), source: Direct(1) }, BinaryIntOp { destination: Direct(1), op: Add, bit_size: U32, lhs: Direct(1), rhs: Direct(2) }, Const { destination: Relative(3), bit_size: Field, value: 0 }, Store { destination_pointer: Relative(2), source: Relative(3) }, Const { destination: Relative(4), bit_size: Integer(U32), value: 5 }, Mov { destination: Relative(5), source: Direct(0) }, Mov { destination: Relative(6), source: Relative(2) }, Mov { destination: Relative(7), source: Relative(2) }, Mov { destination: Relative(8), source: Relative(1) }, BinaryIntOp { destination: Direct(0), op: Add, bit_size: U32, lhs: Direct(0), rhs: Relative(4) }, Call { location: 40 }, Mov { destination: Direct(0), source: Relative(0) }, Mov { destination: Relative(3), source: Relative(6) }, BinaryFieldOp { destination: Relative(1), op: Equals, lhs: Relative(3), rhs: Direct(32835) }, JumpIf { condition: Relative(1), location: 33 }, Const { destination: Relative(2), bit_size: Integer(U32), value: 0 }, Trap { revert_data: HeapVector { pointer: Direct(1), size: Relative(2) } }, Return, Const { destination: Direct(32772), bit_size: Integer(U32), value: 30720 }, BinaryIntOp { destination: Direct(32771), op: LessThan, bit_size: U32, lhs: Direct(0), rhs: Direct(32772) }, JumpIf { condition: Direct(32771), location: 39 }, IndirectConst { destination_pointer: Direct(1), bit_size: Integer(U64), value: 17843811134343075018 }, Trap { revert_data: HeapVector { pointer: Direct(1), size: Direct(2) } }, Return, Call { location: 34 }, Const { destination: Relative(4), bit_size: Integer(U32), value: 0 }, BinaryIntOp { destination: Relative(5), op: Equals, bit_size: U32, lhs: Relative(3), rhs: Relative(4) }, JumpIf { condition: Relative(5), location: 45 }, Call { location: 49 }, Store { destination_pointer: Relative(2), source: Direct(32835) }, Load { destination: Relative(2), source_pointer: Relative(1) }, Mov { destination: Relative(1), source: Relative(2) }, Return, IndirectConst { destination_pointer: Direct(1), bit_size: Integer(U64), value: 14225679739041873922 }, Trap { revert_data: HeapVector { pointer: Direct(1), size: Direct(2) } }, Return]" + ], + "debug_symbols": "[debug_symbols]", + "file_map": "[file_map]", + "names": [ + "main" + ], + "brillig_names": [ + "main" + ] +} diff --git a/tooling/nargo_cli/tests/snapshots/execution_success/regression_9657/execute__tests__force_brillig_true_inliner_0.snap b/tooling/nargo_cli/tests/snapshots/execution_success/regression_9657/execute__tests__force_brillig_true_inliner_0.snap new file mode 100644 index 00000000000..57df28848ba --- /dev/null +++ b/tooling/nargo_cli/tests/snapshots/execution_success/regression_9657/execute__tests__force_brillig_true_inliner_0.snap @@ -0,0 +1,50 @@ +--- +source: tooling/nargo_cli/tests/execute.rs +expression: artifact +--- +{ + "noir_version": "[noir_version]", + "hash": "[hash]", + "abi": { + "parameters": [ + { + "name": "v2", + "type": { + "kind": "integer", + "sign": "unsigned", + "width": 32 + }, + "visibility": "private" + } + ], + "return_type": null, + "error_types": { + "14225679739041873922": { + "error_kind": "string", + "string": "Index out of bounds" + }, + "17843811134343075018": { + "error_kind": "string", + "string": "Stack too deep" + } + } + }, + "bytecode": [ + "func 0", + "current witness index : _0", + "private parameters indices : [_0]", + "public parameters indices : []", + "return value indices : []", + "BRILLIG CALL func 0: inputs: [EXPR [ (1, _0) 0 ]], outputs: []", + "unconstrained func 0", + "[Const { destination: Direct(2), bit_size: Integer(U32), value: 1 }, Const { destination: Direct(1), bit_size: Integer(U32), value: 32837 }, Const { destination: Direct(0), bit_size: Integer(U32), value: 3 }, Const { destination: Relative(2), bit_size: Integer(U32), value: 1 }, Const { destination: Relative(3), bit_size: Integer(U32), value: 0 }, CalldataCopy { destination_address: Direct(32836), size_address: Relative(2), offset_address: Relative(3) }, Cast { destination: Direct(32836), source: Direct(32836), bit_size: Integer(U32) }, Mov { destination: Relative(1), source: Direct(32836) }, Call { location: 13 }, Call { location: 14 }, Const { destination: Relative(1), bit_size: Integer(U32), value: 32837 }, Const { destination: Relative(2), bit_size: Integer(U32), value: 0 }, Stop { return_data: HeapVector { pointer: Relative(1), size: Relative(2) } }, Return, Call { location: 20 }, Const { destination: Relative(2), bit_size: Integer(U32), value: 0 }, BinaryIntOp { destination: Relative(3), op: Equals, bit_size: U32, lhs: Relative(1), rhs: Relative(2) }, JumpIf { condition: Relative(3), location: 19 }, Call { location: 26 }, Return, Const { destination: Direct(32772), bit_size: Integer(U32), value: 30720 }, BinaryIntOp { destination: Direct(32771), op: LessThan, bit_size: U32, lhs: Direct(0), rhs: Direct(32772) }, JumpIf { condition: Direct(32771), location: 25 }, IndirectConst { destination_pointer: Direct(1), bit_size: Integer(U64), value: 17843811134343075018 }, Trap { revert_data: HeapVector { pointer: Direct(1), size: Direct(2) } }, Return, IndirectConst { destination_pointer: Direct(1), bit_size: Integer(U64), value: 14225679739041873922 }, Trap { revert_data: HeapVector { pointer: Direct(1), size: Direct(2) } }, Return]" + ], + "debug_symbols": "[debug_symbols]", + "file_map": "[file_map]", + "names": [ + "main" + ], + "brillig_names": [ + "main" + ] +} diff --git a/tooling/nargo_cli/tests/snapshots/execution_success/regression_9657/execute__tests__force_brillig_true_inliner_9223372036854775807.snap b/tooling/nargo_cli/tests/snapshots/execution_success/regression_9657/execute__tests__force_brillig_true_inliner_9223372036854775807.snap new file mode 100644 index 00000000000..57df28848ba --- /dev/null +++ b/tooling/nargo_cli/tests/snapshots/execution_success/regression_9657/execute__tests__force_brillig_true_inliner_9223372036854775807.snap @@ -0,0 +1,50 @@ +--- +source: tooling/nargo_cli/tests/execute.rs +expression: artifact +--- +{ + "noir_version": "[noir_version]", + "hash": "[hash]", + "abi": { + "parameters": [ + { + "name": "v2", + "type": { + "kind": "integer", + "sign": "unsigned", + "width": 32 + }, + "visibility": "private" + } + ], + "return_type": null, + "error_types": { + "14225679739041873922": { + "error_kind": "string", + "string": "Index out of bounds" + }, + "17843811134343075018": { + "error_kind": "string", + "string": "Stack too deep" + } + } + }, + "bytecode": [ + "func 0", + "current witness index : _0", + "private parameters indices : [_0]", + "public parameters indices : []", + "return value indices : []", + "BRILLIG CALL func 0: inputs: [EXPR [ (1, _0) 0 ]], outputs: []", + "unconstrained func 0", + "[Const { destination: Direct(2), bit_size: Integer(U32), value: 1 }, Const { destination: Direct(1), bit_size: Integer(U32), value: 32837 }, Const { destination: Direct(0), bit_size: Integer(U32), value: 3 }, Const { destination: Relative(2), bit_size: Integer(U32), value: 1 }, Const { destination: Relative(3), bit_size: Integer(U32), value: 0 }, CalldataCopy { destination_address: Direct(32836), size_address: Relative(2), offset_address: Relative(3) }, Cast { destination: Direct(32836), source: Direct(32836), bit_size: Integer(U32) }, Mov { destination: Relative(1), source: Direct(32836) }, Call { location: 13 }, Call { location: 14 }, Const { destination: Relative(1), bit_size: Integer(U32), value: 32837 }, Const { destination: Relative(2), bit_size: Integer(U32), value: 0 }, Stop { return_data: HeapVector { pointer: Relative(1), size: Relative(2) } }, Return, Call { location: 20 }, Const { destination: Relative(2), bit_size: Integer(U32), value: 0 }, BinaryIntOp { destination: Relative(3), op: Equals, bit_size: U32, lhs: Relative(1), rhs: Relative(2) }, JumpIf { condition: Relative(3), location: 19 }, Call { location: 26 }, Return, Const { destination: Direct(32772), bit_size: Integer(U32), value: 30720 }, BinaryIntOp { destination: Direct(32771), op: LessThan, bit_size: U32, lhs: Direct(0), rhs: Direct(32772) }, JumpIf { condition: Direct(32771), location: 25 }, IndirectConst { destination_pointer: Direct(1), bit_size: Integer(U64), value: 17843811134343075018 }, Trap { revert_data: HeapVector { pointer: Direct(1), size: Direct(2) } }, Return, IndirectConst { destination_pointer: Direct(1), bit_size: Integer(U64), value: 14225679739041873922 }, Trap { revert_data: HeapVector { pointer: Direct(1), size: Direct(2) } }, Return]" + ], + "debug_symbols": "[debug_symbols]", + "file_map": "[file_map]", + "names": [ + "main" + ], + "brillig_names": [ + "main" + ] +} diff --git a/tooling/nargo_cli/tests/snapshots/execution_success/regression_9657/execute__tests__stdout.snap b/tooling/nargo_cli/tests/snapshots/execution_success/regression_9657/execute__tests__stdout.snap new file mode 100644 index 00000000000..e86e3de90e1 --- /dev/null +++ b/tooling/nargo_cli/tests/snapshots/execution_success/regression_9657/execute__tests__stdout.snap @@ -0,0 +1,5 @@ +--- +source: tooling/nargo_cli/tests/execute.rs +expression: stdout +--- +