From 8daf96ce4ed4f7b6760acf06f0c1d35ce6bb5a6b Mon Sep 17 00:00:00 2001 From: guipublic Date: Wed, 7 Jun 2023 14:21:31 +0000 Subject: [PATCH 1/6] process jumps between blocks --- .../noirc_evaluator/src/brillig/artifact.rs | 26 +++++++- .../src/brillig/brillig_gen.rs | 61 +++++++++++++++---- 2 files changed, 73 insertions(+), 14 deletions(-) diff --git a/crates/noirc_evaluator/src/brillig/artifact.rs b/crates/noirc_evaluator/src/brillig/artifact.rs index 3152d4a70a1..6aabe921243 100644 --- a/crates/noirc_evaluator/src/brillig/artifact.rs +++ b/crates/noirc_evaluator/src/brillig/artifact.rs @@ -1,10 +1,16 @@ +use std::collections::HashMap; + use acvm::acir::brillig_vm::Opcode as BrilligOpcode; +use crate::ssa_refactor::ir::basic_block::BasicBlockId; + #[derive(Default, Debug, Clone)] /// Artifacts resulting from the compilation of a function into brillig byte code /// Currently it is just the brillig bytecode of the function pub(crate) struct BrilligArtifact { pub(crate) byte_code: Vec, + to_fix: Vec<(usize, BasicBlockId)>, + blocks: HashMap, //processed blocks and their entry point } impl BrilligArtifact { @@ -19,7 +25,25 @@ impl BrilligArtifact { if obj.byte_code.is_empty() { panic!("ICE: unresolved symbol"); } - + let offset = self.code_len(); + for i in &obj.to_fix { + self.to_fix.push((i.0 + offset, i.1)); + } + for i in &obj.blocks { + self.blocks.insert(*i.0, i.1 + offset); + } self.byte_code.extend_from_slice(&obj.byte_code); } + + pub(crate) fn fix_jump(&mut self, destination: BasicBlockId) { + self.to_fix.push((self.code_len(), destination)); + } + + pub(crate) fn start(&mut self, block: BasicBlockId) { + self.blocks.insert(block, self.code_len()); + } + + pub(crate) fn code_len(&self) -> usize { + self.byte_code.len() + } } diff --git a/crates/noirc_evaluator/src/brillig/brillig_gen.rs b/crates/noirc_evaluator/src/brillig/brillig_gen.rs index 09250714bfc..ffa836dfbb6 100644 --- a/crates/noirc_evaluator/src/brillig/brillig_gen.rs +++ b/crates/noirc_evaluator/src/brillig/brillig_gen.rs @@ -1,12 +1,12 @@ use std::collections::HashMap; use crate::ssa_refactor::ir::{ - basic_block::BasicBlock, + basic_block::{BasicBlock, BasicBlockId}, dfg::DataFlowGraph, function::Function, instruction::{Binary, BinaryOp, Instruction, InstructionId, TerminatorInstruction}, types::{NumericType, Type}, - value::{Value, ValueId}, + value::{Value, ValueId}, post_order::PostOrder, }; use super::artifact::BrilligArtifact; @@ -47,14 +47,46 @@ impl BrilligGen { } /// Converts an SSA Basic block into a sequence of Brillig opcodes - fn convert_block(&mut self, block: &BasicBlock, dfg: &DataFlowGraph) { + fn convert_block(&mut self, block_id: BasicBlockId, dfg: &DataFlowGraph) { + self.obj.start(block_id); + let block = &dfg[block_id]; self.convert_block_params(block, dfg); for instruction_id in block.instructions() { self.convert_ssa_instruction(*instruction_id, dfg); } - self.convert_ssa_return(block, dfg); + // Jump to the next block + let jump = block.terminator().expect("block is expected to be constructed"); + match jump { + TerminatorInstruction::JmpIf { condition, then_destination, else_destination } => { + let condition = self.convert_ssa_value(*condition, dfg); + self.jump_if(condition, *then_destination); + self.jump(*else_destination); + } + TerminatorInstruction::Jmp { destination, arguments } => { + let target = &dfg[*destination]; + for (src,dest) in arguments.iter().zip(target.parameters()) { + let destination = self.convert_ssa_value(*dest, dfg); + let source = self.convert_ssa_value(*src, dfg); + self.push_code(BrilligOpcode::Mov { destination, source }); + } + self.jump(*destination); + } + TerminatorInstruction::Return { return_values } => { + self.convert_ssa_return(return_values, dfg); + } , + } + } + + fn jump(&mut self, target: BasicBlockId) { + self.obj.fix_jump(target); + self.push_code(BrilligOpcode::Jump { location: 0 }); + } + + fn jump_if(&mut self, condition: RegisterIndex, target: BasicBlockId) { + self.obj.fix_jump(target); + self.push_code(BrilligOpcode::JumpIf { condition, location: 0 }); } /// Converts the SSA return instruction into the necessary BRillig return @@ -63,12 +95,7 @@ impl BrilligGen { /// For Brillig, the return is implicit; The caller will take `N` values from /// the Register starting at register index 0. `N` indicates the number of /// return values expected. - fn convert_ssa_return(&mut self, block: &BasicBlock, dfg: &DataFlowGraph) { - let return_values = match block.terminator().unwrap() { - TerminatorInstruction::Return { return_values } => return_values, - _ => todo!("ICE: Unsupported return"), - }; - + fn convert_ssa_return(&mut self, return_values: &[ValueId], dfg: &DataFlowGraph) { // Check if the program returns the `Unit/None` type. // This type signifies that the program returns nothing. let is_return_unit_type = @@ -193,14 +220,22 @@ impl BrilligGen { pub(crate) fn compile(func: &Function) -> BrilligArtifact { let mut brillig = BrilligGen::default(); - let dfg = &func.dfg; - - brillig.convert_block(&dfg[func.entry_block()], dfg); + brillig.convert_blocks(func); brillig.push_code(BrilligOpcode::Stop); brillig.obj } + + fn convert_blocks(&mut self, func: &Function) + { + let mut rpo = Vec::new(); + rpo.extend_from_slice(PostOrder::with_function(func).as_slice()); + rpo.reverse(); + for b in rpo { + self.convert_block(b, &func.dfg); + } + } } /// Type to encapsulate the binary operation types in Brillig From bc685967c1a500992855fac8c88be42ae28e5c40 Mon Sep 17 00:00:00 2001 From: guipublic Date: Wed, 7 Jun 2023 14:29:38 +0000 Subject: [PATCH 2/6] fix jumps --- .../noirc_evaluator/src/brillig/artifact.rs | 29 +++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/crates/noirc_evaluator/src/brillig/artifact.rs b/crates/noirc_evaluator/src/brillig/artifact.rs index 6aabe921243..8fa0615de12 100644 --- a/crates/noirc_evaluator/src/brillig/artifact.rs +++ b/crates/noirc_evaluator/src/brillig/artifact.rs @@ -17,6 +17,7 @@ impl BrilligArtifact { // Link some compiled brillig bytecode with its referenced artifacts pub(crate) fn link(&mut self, obj: &BrilligArtifact) -> Vec { self.link_with(obj); + self.fix_jumps(); self.byte_code.clone() } @@ -46,4 +47,32 @@ impl BrilligArtifact { pub(crate) fn code_len(&self) -> usize { self.byte_code.len() } + + fn fix_jumps(&mut self) { + for (jump, block) in &self.to_fix { + match self.byte_code[*jump] { + BrilligOpcode::Jump { location } => { + assert_eq!(location, 0); + let current = self.blocks[block]; + self.byte_code[*jump] = BrilligOpcode::Jump { location: current }; + } + BrilligOpcode::JumpIfNot { condition, location } => { + let current = if location == 0 { + self.blocks[block] + } else { + location + self.byte_code.len() + }; + self.byte_code[*jump] = + BrilligOpcode::JumpIfNot { condition, location: current }; + } + BrilligOpcode::JumpIf { condition, location } => { + assert_eq!(location, 0); + let current = self.blocks[block]; + self.byte_code[*jump] = + BrilligOpcode::JumpIf { condition, location: current }; + } + _ => unreachable!(), + } + } + } } From 98968c1920a25769b3fedddd0baf283232842fb1 Mon Sep 17 00:00:00 2001 From: kevaundray Date: Wed, 7 Jun 2023 15:12:45 +0000 Subject: [PATCH 3/6] add doc comments --- .../brillig_conditional/Nargo.toml | 5 ++ .../brillig_conditional/Prover.toml | 1 + .../brillig_conditional/src/main.nr | 14 ++++ .../noirc_evaluator/src/brillig/artifact.rs | 59 +++++++++----- .../src/brillig/brillig_gen.rs | 76 ++++++++++--------- 5 files changed, 101 insertions(+), 54 deletions(-) create mode 100644 crates/nargo_cli/tests/test_data_ssa_refactor/brillig_conditional/Nargo.toml create mode 100644 crates/nargo_cli/tests/test_data_ssa_refactor/brillig_conditional/Prover.toml create mode 100644 crates/nargo_cli/tests/test_data_ssa_refactor/brillig_conditional/src/main.nr diff --git a/crates/nargo_cli/tests/test_data_ssa_refactor/brillig_conditional/Nargo.toml b/crates/nargo_cli/tests/test_data_ssa_refactor/brillig_conditional/Nargo.toml new file mode 100644 index 00000000000..e0b467ce5da --- /dev/null +++ b/crates/nargo_cli/tests/test_data_ssa_refactor/brillig_conditional/Nargo.toml @@ -0,0 +1,5 @@ +[package] +authors = [""] +compiler_version = "0.1" + +[dependencies] \ No newline at end of file diff --git a/crates/nargo_cli/tests/test_data_ssa_refactor/brillig_conditional/Prover.toml b/crates/nargo_cli/tests/test_data_ssa_refactor/brillig_conditional/Prover.toml new file mode 100644 index 00000000000..4dd6b405159 --- /dev/null +++ b/crates/nargo_cli/tests/test_data_ssa_refactor/brillig_conditional/Prover.toml @@ -0,0 +1 @@ +x = "1" diff --git a/crates/nargo_cli/tests/test_data_ssa_refactor/brillig_conditional/src/main.nr b/crates/nargo_cli/tests/test_data_ssa_refactor/brillig_conditional/src/main.nr new file mode 100644 index 00000000000..c5984eb6dd6 --- /dev/null +++ b/crates/nargo_cli/tests/test_data_ssa_refactor/brillig_conditional/src/main.nr @@ -0,0 +1,14 @@ +// Tests a very simple program. +// +// The features being tested is basic arithmetics on brillig +fn main(x: Field) { + assert(4 == conditional(x as bool)); +} + +unconstrained fn conditional(x : bool) -> Field { + if x { + 4 + }else { + 5 + } +} \ No newline at end of file diff --git a/crates/noirc_evaluator/src/brillig/artifact.rs b/crates/noirc_evaluator/src/brillig/artifact.rs index 8fa0615de12..f96ab9131ca 100644 --- a/crates/noirc_evaluator/src/brillig/artifact.rs +++ b/crates/noirc_evaluator/src/brillig/artifact.rs @@ -4,52 +4,72 @@ use acvm::acir::brillig_vm::Opcode as BrilligOpcode; use crate::ssa_refactor::ir::basic_block::BasicBlockId; +/// Pointer to a unresolved Jump instruction in +/// the bytecode. +pub(crate) type JumpLabel = usize; + +/// Pointer to a position in the bytecode where a +/// particular basic block starts. +pub(crate) type BlockLabel = usize; + #[derive(Default, Debug, Clone)] -/// Artifacts resulting from the compilation of a function into brillig byte code -/// Currently it is just the brillig bytecode of the function +/// Artifacts resulting from the compilation of a function into brillig byte code. +/// Currently it is just the brillig bytecode of the function. pub(crate) struct BrilligArtifact { pub(crate) byte_code: Vec, - to_fix: Vec<(usize, BasicBlockId)>, - blocks: HashMap, //processed blocks and their entry point + /// The set of jumps that need to have their locations + /// resolved. + unresolved_jumps: Vec<(JumpLabel, BasicBlockId)>, + /// A map of the basic blocks to their positions + /// in the bytecode. + blocks: HashMap, } impl BrilligArtifact { - // Link some compiled brillig bytecode with its referenced artifacts + /// Link some compiled brillig bytecode with its referenced artifacts pub(crate) fn link(&mut self, obj: &BrilligArtifact) -> Vec { self.link_with(obj); - self.fix_jumps(); + self.resolve_jumps(); self.byte_code.clone() } - // Link with a brillig artifact + /// Link with a brillig artifact fn link_with(&mut self, obj: &BrilligArtifact) { if obj.byte_code.is_empty() { panic!("ICE: unresolved symbol"); } + let offset = self.code_len(); - for i in &obj.to_fix { - self.to_fix.push((i.0 + offset, i.1)); + for i in &obj.unresolved_jumps { + self.unresolved_jumps.push((i.0 + offset, i.1)); } for i in &obj.blocks { self.blocks.insert(*i.0, i.1 + offset); } self.byte_code.extend_from_slice(&obj.byte_code); } - - pub(crate) fn fix_jump(&mut self, destination: BasicBlockId) { - self.to_fix.push((self.code_len(), destination)); - } - pub(crate) fn start(&mut self, block: BasicBlockId) { + /// Adds a unresolved jump to be fixed at the end of bytecode processing. + pub(crate) fn add_unresolved_jump(&mut self, destination: BasicBlockId) { + self.unresolved_jumps.push((self.code_len(), destination)); + } + + /// Adds a label in the bytecode to specify where this block's + /// opcodes will start. + pub(crate) fn add_block_label(&mut self, block: BasicBlockId) { self.blocks.insert(block, self.code_len()); - } + } - pub(crate) fn code_len(&self) -> usize { + /// Number of the opcodes currently in the bytecode + pub(crate) fn code_len(&self) -> usize { self.byte_code.len() } - fn fix_jumps(&mut self) { - for (jump, block) in &self.to_fix { + /// Resolves all of the unresolved jumps in the program. + /// + /// Note: This should only be called once all blocks are processed. + fn resolve_jumps(&mut self) { + for (jump, block) in &self.unresolved_jumps { match self.byte_code[*jump] { BrilligOpcode::Jump { location } => { assert_eq!(location, 0); @@ -68,8 +88,7 @@ impl BrilligArtifact { BrilligOpcode::JumpIf { condition, location } => { assert_eq!(location, 0); let current = self.blocks[block]; - self.byte_code[*jump] = - BrilligOpcode::JumpIf { condition, location: current }; + self.byte_code[*jump] = BrilligOpcode::JumpIf { condition, location: current }; } _ => unreachable!(), } diff --git a/crates/noirc_evaluator/src/brillig/brillig_gen.rs b/crates/noirc_evaluator/src/brillig/brillig_gen.rs index ffa836dfbb6..e0ad5dc1b72 100644 --- a/crates/noirc_evaluator/src/brillig/brillig_gen.rs +++ b/crates/noirc_evaluator/src/brillig/brillig_gen.rs @@ -5,8 +5,9 @@ use crate::ssa_refactor::ir::{ dfg::DataFlowGraph, function::Function, instruction::{Binary, BinaryOp, Instruction, InstructionId, TerminatorInstruction}, + post_order::PostOrder, types::{NumericType, Type}, - value::{Value, ValueId}, post_order::PostOrder, + value::{Value, ValueId}, }; use super::artifact::BrilligArtifact; @@ -48,44 +49,46 @@ impl BrilligGen { /// Converts an SSA Basic block into a sequence of Brillig opcodes fn convert_block(&mut self, block_id: BasicBlockId, dfg: &DataFlowGraph) { - self.obj.start(block_id); - let block = &dfg[block_id]; + self.obj.add_block_label(block_id); + let block = &dfg[dbg!(block_id)]; self.convert_block_params(block, dfg); for instruction_id in block.instructions() { self.convert_ssa_instruction(*instruction_id, dfg); } - // Jump to the next block - let jump = block.terminator().expect("block is expected to be constructed"); - match jump { - TerminatorInstruction::JmpIf { condition, then_destination, else_destination } => { - let condition = self.convert_ssa_value(*condition, dfg); - self.jump_if(condition, *then_destination); - self.jump(*else_destination); - } - TerminatorInstruction::Jmp { destination, arguments } => { - let target = &dfg[*destination]; - for (src,dest) in arguments.iter().zip(target.parameters()) { - let destination = self.convert_ssa_value(*dest, dfg); - let source = self.convert_ssa_value(*src, dfg); - self.push_code(BrilligOpcode::Mov { destination, source }); - } - self.jump(*destination); - } - TerminatorInstruction::Return { return_values } => { - self.convert_ssa_return(return_values, dfg); - } , + // Jump to the next block + let jump = block.terminator().expect("block is expected to be constructed"); + match jump { + TerminatorInstruction::JmpIf { condition, then_destination, else_destination } => { + let condition = self.convert_ssa_value(*condition, dfg); + self.jump_if(condition, *then_destination); + self.jump(*else_destination); + } + TerminatorInstruction::Jmp { destination, arguments } => { + let target = &dfg[*destination]; + for (src, dest) in arguments.iter().zip(target.parameters()) { + let destination = self.convert_ssa_value(*dest, dfg); + let source = self.convert_ssa_value(*src, dfg); + self.push_code(BrilligOpcode::Mov { destination, source }); } + self.jump(*destination); + } + TerminatorInstruction::Return { return_values } => { + self.convert_ssa_return(return_values, dfg); + } + } } + /// Adds a unresolved `Jump` instruction to the bytecode. fn jump(&mut self, target: BasicBlockId) { - self.obj.fix_jump(target); + self.obj.add_unresolved_jump(target); self.push_code(BrilligOpcode::Jump { location: 0 }); } + /// Adds a unresolved `JumpIf` instruction to the bytecode. fn jump_if(&mut self, condition: RegisterIndex, target: BasicBlockId) { - self.obj.fix_jump(target); + self.obj.add_unresolved_jump(target); self.push_code(BrilligOpcode::JumpIf { condition, location: 0 }); } @@ -198,7 +201,7 @@ impl BrilligGen { Value::Param { .. } | Value::Instruction { .. } => { // All block parameters and instruction results should have already been // converted to registers so we fetch from the cache. - self.ssa_value_to_register[&value_id] + self.get_or_create_register(value_id) } Value::NumericConstant { constant, .. } => { let register_index = self.get_or_create_register(value_id); @@ -220,20 +223,25 @@ impl BrilligGen { pub(crate) fn compile(func: &Function) -> BrilligArtifact { let mut brillig = BrilligGen::default(); - brillig.convert_blocks(func); + brillig.convert_ssa_function(func); brillig.push_code(BrilligOpcode::Stop); brillig.obj } - fn convert_blocks(&mut self, func: &Function) - { - let mut rpo = Vec::new(); - rpo.extend_from_slice(PostOrder::with_function(func).as_slice()); - rpo.reverse(); - for b in rpo { - self.convert_block(b, &func.dfg); + /// Converting an SSA function into Brillig bytecode. + /// + /// TODO: Change this to use `dfg.basic_blocks_iter` which will return an + /// TODO iterator of all of the basic blocks. + /// TODO(Jake): what order is this ^ + fn convert_ssa_function(&mut self, func: &Function) { + let mut reverse_post_order = Vec::new(); + reverse_post_order.extend_from_slice(PostOrder::with_function(func).as_slice()); + reverse_post_order.reverse(); + + for block in reverse_post_order { + self.convert_block(block, &func.dfg); } } } From 46e36d0195e2101739c8512664790d11c594454c Mon Sep 17 00:00:00 2001 From: kevaundray Date: Wed, 7 Jun 2023 15:57:35 +0000 Subject: [PATCH 4/6] cargo fmt --- crates/noirc_evaluator/src/brillig/brillig_gen.rs | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/crates/noirc_evaluator/src/brillig/brillig_gen.rs b/crates/noirc_evaluator/src/brillig/brillig_gen.rs index e0ad5dc1b72..f57503dd5e5 100644 --- a/crates/noirc_evaluator/src/brillig/brillig_gen.rs +++ b/crates/noirc_evaluator/src/brillig/brillig_gen.rs @@ -1,5 +1,4 @@ -use std::collections::HashMap; - +use super::artifact::BrilligArtifact; use crate::ssa_refactor::ir::{ basic_block::{BasicBlock, BasicBlockId}, dfg::DataFlowGraph, @@ -9,12 +8,11 @@ use crate::ssa_refactor::ir::{ types::{NumericType, Type}, value::{Value, ValueId}, }; - -use super::artifact::BrilligArtifact; - use acvm::acir::brillig_vm::{ BinaryFieldOp, BinaryIntOp, Opcode as BrilligOpcode, RegisterIndex, Value as BrilligValue, }; +use std::collections::HashMap; + #[derive(Default)] /// Generate the compilation artifacts for compiling a function into brillig bytecode. pub(crate) struct BrilligGen { From a5de4c3692283252b0ffbbbefce4d17872e293d2 Mon Sep 17 00:00:00 2001 From: kevaundray Date: Wed, 7 Jun 2023 15:57:54 +0000 Subject: [PATCH 5/6] code refactor --- .../noirc_evaluator/src/brillig/artifact.rs | 59 ++++++++++--------- 1 file changed, 30 insertions(+), 29 deletions(-) diff --git a/crates/noirc_evaluator/src/brillig/artifact.rs b/crates/noirc_evaluator/src/brillig/artifact.rs index f96ab9131ca..c3129f0390e 100644 --- a/crates/noirc_evaluator/src/brillig/artifact.rs +++ b/crates/noirc_evaluator/src/brillig/artifact.rs @@ -1,8 +1,6 @@ -use std::collections::HashMap; - -use acvm::acir::brillig_vm::Opcode as BrilligOpcode; - use crate::ssa_refactor::ir::basic_block::BasicBlockId; +use acvm::acir::brillig_vm::Opcode as BrilligOpcode; +use std::collections::HashMap; /// Pointer to a unresolved Jump instruction in /// the bytecode. @@ -26,7 +24,7 @@ pub(crate) struct BrilligArtifact { } impl BrilligArtifact { - /// Link some compiled brillig bytecode with its referenced artifacts + /// Link some compiled brillig bytecode with its referenced artifacts. pub(crate) fn link(&mut self, obj: &BrilligArtifact) -> Vec { self.link_with(obj); self.resolve_jumps(); @@ -35,17 +33,15 @@ impl BrilligArtifact { /// Link with a brillig artifact fn link_with(&mut self, obj: &BrilligArtifact) { - if obj.byte_code.is_empty() { - panic!("ICE: unresolved symbol"); - } - let offset = self.code_len(); - for i in &obj.unresolved_jumps { - self.unresolved_jumps.push((i.0 + offset, i.1)); + for (jump_label, block_id) in &obj.unresolved_jumps { + self.unresolved_jumps.push((jump_label + offset, *block_id)); } - for i in &obj.blocks { - self.blocks.insert(*i.0, i.1 + offset); + + for (block_id, block_label) in &obj.blocks { + self.blocks.insert(*block_id, block_label + offset); } + self.byte_code.extend_from_slice(&obj.byte_code); } @@ -69,28 +65,33 @@ impl BrilligArtifact { /// /// Note: This should only be called once all blocks are processed. fn resolve_jumps(&mut self) { - for (jump, block) in &self.unresolved_jumps { - match self.byte_code[*jump] { + for (jump_label, block) in &self.unresolved_jumps { + let jump_instruction = self.byte_code[*jump_label].clone(); + + let actual_block_location = self.blocks[block]; + + match jump_instruction { BrilligOpcode::Jump { location } => { - assert_eq!(location, 0); - let current = self.blocks[block]; - self.byte_code[*jump] = BrilligOpcode::Jump { location: current }; + assert_eq!(location, 0, "location is not zero, which means that the jump label does not need resolving"); + + self.byte_code[*jump_label] = + BrilligOpcode::Jump { location: actual_block_location }; } BrilligOpcode::JumpIfNot { condition, location } => { - let current = if location == 0 { - self.blocks[block] - } else { - location + self.byte_code.len() - }; - self.byte_code[*jump] = - BrilligOpcode::JumpIfNot { condition, location: current }; + assert_eq!(location, 0, "location is not zero, which means that the jump label does not need resolving"); + + self.byte_code[*jump_label] = + BrilligOpcode::JumpIfNot { condition, location: actual_block_location }; } BrilligOpcode::JumpIf { condition, location } => { - assert_eq!(location, 0); - let current = self.blocks[block]; - self.byte_code[*jump] = BrilligOpcode::JumpIf { condition, location: current }; + assert_eq!(location, 0,"location is not zero, which means that the jump label does not need resolving"); + + self.byte_code[*jump_label] = + BrilligOpcode::JumpIf { condition, location: actual_block_location }; } - _ => unreachable!(), + _ => unreachable!( + "all jump labels should point to a jump instruction in the bytecode" + ), } } } From 8fc8f758fd5479ef0b8c3f88524f49c2e8f01b42 Mon Sep 17 00:00:00 2001 From: kevaundray Date: Wed, 7 Jun 2023 15:58:06 +0000 Subject: [PATCH 6/6] update code comment --- .../test_data_ssa_refactor/brillig_conditional/src/main.nr | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/nargo_cli/tests/test_data_ssa_refactor/brillig_conditional/src/main.nr b/crates/nargo_cli/tests/test_data_ssa_refactor/brillig_conditional/src/main.nr index c5984eb6dd6..4ddd351ad04 100644 --- a/crates/nargo_cli/tests/test_data_ssa_refactor/brillig_conditional/src/main.nr +++ b/crates/nargo_cli/tests/test_data_ssa_refactor/brillig_conditional/src/main.nr @@ -1,6 +1,6 @@ // Tests a very simple program. // -// The features being tested is basic arithmetics on brillig +// The features being tested is basic conditonal on brillig fn main(x: Field) { assert(4 == conditional(x as bool)); }