From 04249262b3477d79fbd1d2cf31d87a1dfb79a6ae Mon Sep 17 00:00:00 2001 From: Tom French Date: Tue, 3 Sep 2024 11:00:27 +0100 Subject: [PATCH 01/12] feat: simplify `jmpif`s by reversing branches if condition is negated --- .../src/ssa/opt/simplify_cfg.rs | 34 +++++++++++++++++-- 1 file changed, 32 insertions(+), 2 deletions(-) diff --git a/compiler/noirc_evaluator/src/ssa/opt/simplify_cfg.rs b/compiler/noirc_evaluator/src/ssa/opt/simplify_cfg.rs index 0a3b2a800ca..2d6b61b67df 100644 --- a/compiler/noirc_evaluator/src/ssa/opt/simplify_cfg.rs +++ b/compiler/noirc_evaluator/src/ssa/opt/simplify_cfg.rs @@ -15,8 +15,11 @@ use acvm::acir::AcirField; use crate::ssa::{ ir::{ - basic_block::BasicBlockId, cfg::ControlFlowGraph, function::Function, - instruction::TerminatorInstruction, + basic_block::BasicBlockId, + cfg::ControlFlowGraph, + function::Function, + instruction::{Instruction, TerminatorInstruction}, + value::Value, }, ssa_gen::Ssa, }; @@ -29,6 +32,7 @@ impl Ssa { /// 4. Removing any blocks which have no instructions other than a single terminating jmp. /// 5. Replacing any jmpifs with constant conditions with jmps. If this causes the block to have /// only 1 successor then (2) also will be applied. + /// 6. Replacing any jmpifs with a negated condition with a jmpif with a un-negated condition and reversed branches. /// /// Currently, 1 and 4 are unimplemented. #[tracing::instrument(level = "trace", skip(self))] @@ -52,6 +56,8 @@ fn simplify_function(function: &mut Function) { stack.extend(function.dfg[block].successors().filter(|block| !visited.contains(block))); } + check_for_negated_jmpif_condition(function, block); + // This call is before try_inline_into_predecessor so that if it succeeds in changing a // jmpif into a jmp, the block may then be inlined entirely into its predecessor in try_inline_into_predecessor. check_for_constant_jmpif(function, block, &mut cfg); @@ -102,6 +108,30 @@ fn check_for_constant_jmpif( } } +/// Optimize a jmpif on a negated condition by swapping the branches. +fn check_for_negated_jmpif_condition(function: &mut Function, block: BasicBlockId) { + if let Some(TerminatorInstruction::JmpIf { + condition, + then_destination, + else_destination, + call_stack, + }) = function.dfg[block].terminator() + { + if let Value::Instruction { instruction, .. } = function.dfg[*condition] { + if let Instruction::Not(negated_condition) = function.dfg[instruction] { + let call_stack = call_stack.clone(); + let jmpif = TerminatorInstruction::JmpIf { + condition: negated_condition, + then_destination: *else_destination, + else_destination: *then_destination, + call_stack, + }; + function.dfg[block].set_terminator(jmpif); + } + } + } +} + /// If the given block has block parameters, replace them with the jump arguments from the predecessor. /// /// Currently, if this function is needed, `try_inline_into_predecessor` will also always apply, From ccd1a643b9b30a27b0f416d1f5705dc5f4940ac5 Mon Sep 17 00:00:00 2001 From: Tom French Date: Tue, 3 Sep 2024 11:34:05 +0100 Subject: [PATCH 02/12] . --- compiler/noirc_evaluator/src/ssa/opt/simplify_cfg.rs | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/compiler/noirc_evaluator/src/ssa/opt/simplify_cfg.rs b/compiler/noirc_evaluator/src/ssa/opt/simplify_cfg.rs index 2d6b61b67df..f2ade4c372f 100644 --- a/compiler/noirc_evaluator/src/ssa/opt/simplify_cfg.rs +++ b/compiler/noirc_evaluator/src/ssa/opt/simplify_cfg.rs @@ -56,7 +56,7 @@ fn simplify_function(function: &mut Function) { stack.extend(function.dfg[block].successors().filter(|block| !visited.contains(block))); } - check_for_negated_jmpif_condition(function, block); + check_for_negated_jmpif_condition(function, block, &mut cfg); // This call is before try_inline_into_predecessor so that if it succeeds in changing a // jmpif into a jmp, the block may then be inlined entirely into its predecessor in try_inline_into_predecessor. @@ -109,7 +109,11 @@ fn check_for_constant_jmpif( } /// Optimize a jmpif on a negated condition by swapping the branches. -fn check_for_negated_jmpif_condition(function: &mut Function, block: BasicBlockId) { +fn check_for_negated_jmpif_condition( + function: &mut Function, + block: BasicBlockId, + cfg: &mut ControlFlowGraph, +) { if let Some(TerminatorInstruction::JmpIf { condition, then_destination, @@ -127,6 +131,7 @@ fn check_for_negated_jmpif_condition(function: &mut Function, block: BasicBlockI call_stack, }; function.dfg[block].set_terminator(jmpif); + cfg.recompute_block(function, block); } } } From eb7d143f6f12de1d0452e065ef6c41183bc39c38 Mon Sep 17 00:00:00 2001 From: Tom French Date: Tue, 3 Sep 2024 19:50:46 +0100 Subject: [PATCH 03/12] chore: add minimal repro --- .../execution_success/negated_jmpif_condition/Nargo.toml | 6 ++++++ .../negated_jmpif_condition/Prover.toml | 1 + .../negated_jmpif_condition/src/main.nr | 9 +++++++++ 3 files changed, 16 insertions(+) create mode 100644 test_programs/execution_success/negated_jmpif_condition/Nargo.toml create mode 100644 test_programs/execution_success/negated_jmpif_condition/Prover.toml create mode 100644 test_programs/execution_success/negated_jmpif_condition/src/main.nr diff --git a/test_programs/execution_success/negated_jmpif_condition/Nargo.toml b/test_programs/execution_success/negated_jmpif_condition/Nargo.toml new file mode 100644 index 00000000000..c83e2c1c1fd --- /dev/null +++ b/test_programs/execution_success/negated_jmpif_condition/Nargo.toml @@ -0,0 +1,6 @@ +[package] +name = "negated_jmpif_condition" +type = "bin" +authors = [""] + +[dependencies] diff --git a/test_programs/execution_success/negated_jmpif_condition/Prover.toml b/test_programs/execution_success/negated_jmpif_condition/Prover.toml new file mode 100644 index 00000000000..151faa5a9b1 --- /dev/null +++ b/test_programs/execution_success/negated_jmpif_condition/Prover.toml @@ -0,0 +1 @@ +x = "2" \ No newline at end of file diff --git a/test_programs/execution_success/negated_jmpif_condition/src/main.nr b/test_programs/execution_success/negated_jmpif_condition/src/main.nr new file mode 100644 index 00000000000..06de2b41820 --- /dev/null +++ b/test_programs/execution_success/negated_jmpif_condition/src/main.nr @@ -0,0 +1,9 @@ +fn main(mut x: Field) { + let mut q = 0; + + if x != 10 { + q = 2; + } + + assert(q == 2); +} From 3176b10478dbfb13822accf3a030c6ddaec98d3a Mon Sep 17 00:00:00 2001 From: Tom French Date: Tue, 3 Sep 2024 20:26:12 +0100 Subject: [PATCH 04/12] chore: add test to `simplify_cfg` --- .../src/ssa/opt/simplify_cfg.rs | 76 +++++++++++++++++++ 1 file changed, 76 insertions(+) diff --git a/compiler/noirc_evaluator/src/ssa/opt/simplify_cfg.rs b/compiler/noirc_evaluator/src/ssa/opt/simplify_cfg.rs index f2ade4c372f..c56f65241ce 100644 --- a/compiler/noirc_evaluator/src/ssa/opt/simplify_cfg.rs +++ b/compiler/noirc_evaluator/src/ssa/opt/simplify_cfg.rs @@ -312,4 +312,80 @@ mod test { other => panic!("Unexpected terminator {other:?}"), } } + + #[test] + fn swap_negated_jmpif_branches() { + // fn main { + // b0(v0: bool): + // v4 = allocate + // store Field 0 at v4 + // v5 = not v0 + // jmpif v5 then: b1, else: b2 + // b1(): + // store Field 1 at v4 + // jmp b2() + // b2(): + // v6 = load v4 + // constrain v6 == Field 1 + // return + // } + let main_id = Id::test_new(0); + let mut builder = FunctionBuilder::new("main".into(), main_id); + let v0 = builder.add_parameter(Type::bool()); + + let b1 = builder.insert_block(); + let b2 = builder.insert_block(); + + let zero = builder.field_constant(0u128); + let one = builder.field_constant(2u128); + + let v4 = builder.insert_allocate(Type::field()); + builder.insert_store(v4, zero); + let v6 = builder.insert_not(v0); + builder.terminate_with_jmpif(v6, b1, b2); + + builder.switch_to_block(b1); + builder.insert_store(v4, one); + builder.terminate_with_jmp(b2, Vec::new()); + + builder.switch_to_block(b2); + let v6 = builder.insert_load(v4, Type::field()); + builder.insert_constrain(v6, one, None); + builder.terminate_with_return(Vec::new()); + + let ssa = builder.finish(); + + println!("{ssa}"); + assert_eq!(ssa.main().reachable_blocks().len(), 3); + + // Expected output: + // fn main { + // b0(v0: bool): + // v4 = allocate + // store Field 0 at v4 + // v5 = not v0 + // jmpif v0 then: b2, else: b1 + // b1(): + // store Field 1 at v4 + // jmp b2() + // b2(): + // v6 = load v4 + // constrain v6 == Field 1 + // return + // } + let ssa = ssa.simplify_cfg(); + + println!("{ssa}"); + + let main = ssa.main(); + assert_eq!(main.reachable_blocks().len(), 3); + + let entry_block = &main.dfg[main.entry_block()]; + + // TODO: more rigorous testing + assert!(matches!( + entry_block.unwrap_terminator(), + TerminatorInstruction::JmpIf { condition, then_destination, else_destination, .. } if *condition == v0 && *then_destination == b2 && *else_destination == b1 + )); + } } From bff01b53e53990a1f42685555439f0123f42440f Mon Sep 17 00:00:00 2001 From: Tom French Date: Wed, 2 Oct 2024 13:02:05 +0100 Subject: [PATCH 05/12] . --- compiler/noirc_evaluator/src/ssa/opt/simplify_cfg.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/compiler/noirc_evaluator/src/ssa/opt/simplify_cfg.rs b/compiler/noirc_evaluator/src/ssa/opt/simplify_cfg.rs index 13b04c82f63..9da5f522731 100644 --- a/compiler/noirc_evaluator/src/ssa/opt/simplify_cfg.rs +++ b/compiler/noirc_evaluator/src/ssa/opt/simplify_cfg.rs @@ -57,11 +57,11 @@ impl Function { stack.extend(self.dfg[block].successors().filter(|block| !visited.contains(block))); } - check_for_negated_jmpif_condition(function, block, &mut cfg); + check_for_negated_jmpif_condition(self, block, &mut cfg); // This call is before try_inline_into_predecessor so that if it succeeds in changing a // jmpif into a jmp, the block may then be inlined entirely into its predecessor in try_inline_into_predecessor. - check_for_constant_jmpif(function, block, &mut cfg); + check_for_constant_jmpif(self, block, &mut cfg); let mut predecessors = cfg.predecessors(block); From 23c8ad898c45520d4f73f8212233991e41079cbd Mon Sep 17 00:00:00 2001 From: Tom French Date: Mon, 25 Nov 2024 22:07:27 +0000 Subject: [PATCH 06/12] chore: add test case --- .../src/ssa/opt/flatten_cfg.rs | 56 +++++++++++++++++++ 1 file changed, 56 insertions(+) diff --git a/compiler/noirc_evaluator/src/ssa/opt/flatten_cfg.rs b/compiler/noirc_evaluator/src/ssa/opt/flatten_cfg.rs index 61a93aee58d..3eeaf21161d 100644 --- a/compiler/noirc_evaluator/src/ssa/opt/flatten_cfg.rs +++ b/compiler/noirc_evaluator/src/ssa/opt/flatten_cfg.rs @@ -1463,4 +1463,60 @@ mod test { _ => unreachable!("Should have terminator instruction"), } } + + #[test] + fn correctly_handles_a_negated_jmpif() { + // This program is a regression test for the below program + // + // ```noir + // fn main(x: bool) { + // let mut q = 0; + // + // if x != true { + // q = 2; + // } + // + // assert(q == 2); + // } + // ``` + + let src = " + acir(inline) fn main f0 { + b0(v0: u1): + v1 = allocate -> &mut Field + store Field 0 at v1 + jmpif v0 then: b2, else: b1 + b2(): + v5 = load v1 -> Field + constrain v5 == Field 2 + return + b1(): + store Field 2 at v1 + jmp b2() + } + "; + let ssa = Ssa::from_str(src).unwrap(); + + let ssa = ssa.flatten_cfg(); + let expected = " + acir(inline) fn main f0 { + b0(v0: u1): + v1 = allocate -> &mut Field + store Field 0 at v1 // let q = 0 + enable_side_effects v0 + v3 = load v1 -> Field // 0 + v4 = cast v0 as Field // x + v6 = sub Field 2, v3 // 2 - 0 + v7 = mul v4, v6 // 2 * x + v8 = add v3, v7 // 0 + 2 * x + store v8 at v1 // q = 2 * x <- THIS IS VERY WRONG. This should be q = 2 * !x. + v9 = not v0 + enable_side_effects u1 1 + v11 = load v1 -> Field + constrain v11 == Field 2 + return + } + "; + assert_normalized_ssa_equals(ssa, expected); + } } From d47499d9e88ea3adc873f632521ecf83aea3dd28 Mon Sep 17 00:00:00 2001 From: Tom French Date: Mon, 25 Nov 2024 22:12:35 +0000 Subject: [PATCH 07/12] chore: use ssa parser for test case --- .../src/ssa/opt/simplify_cfg.rs | 109 ++++++------------ 1 file changed, 37 insertions(+), 72 deletions(-) diff --git a/compiler/noirc_evaluator/src/ssa/opt/simplify_cfg.rs b/compiler/noirc_evaluator/src/ssa/opt/simplify_cfg.rs index 4e9a86d78f4..dea7556a851 100644 --- a/compiler/noirc_evaluator/src/ssa/opt/simplify_cfg.rs +++ b/compiler/noirc_evaluator/src/ssa/opt/simplify_cfg.rs @@ -279,6 +279,8 @@ mod test { map::Id, types::Type, }, + opt::assert_normalized_ssa_equals, + Ssa, }; use acvm::acir::AcirField; @@ -395,77 +397,40 @@ mod test { #[test] fn swap_negated_jmpif_branches() { - // fn main { - // b0(v0: bool): - // v4 = allocate - // store Field 0 at v4 - // v5 = not v0 - // jmpif v5 then: b1, else: b2 - // b1(): - // store Field 1 at v4 - // jmp b2() - // b2(): - // v6 = load v4 - // constrain v6 == Field 1 - // return - // } - let main_id = Id::test_new(0); - let mut builder = FunctionBuilder::new("main".into(), main_id); - let v0 = builder.add_parameter(Type::bool()); - - let b1 = builder.insert_block(); - let b2 = builder.insert_block(); - - let zero = builder.field_constant(0u128); - let one = builder.field_constant(2u128); - - let v4 = builder.insert_allocate(Type::field()); - builder.insert_store(v4, zero); - let v6 = builder.insert_not(v0); - builder.terminate_with_jmpif(v6, b1, b2); - - builder.switch_to_block(b1); - builder.insert_store(v4, one); - builder.terminate_with_jmp(b2, Vec::new()); - - builder.switch_to_block(b2); - let v6 = builder.insert_load(v4, Type::field()); - builder.insert_constrain(v6, one, None); - builder.terminate_with_return(Vec::new()); - - let ssa = builder.finish(); - - println!("{ssa}"); - assert_eq!(ssa.main().reachable_blocks().len(), 3); - - // Expected output: - // fn main { - // b0(v0: bool): - // v4 = allocate - // store Field 0 at v4 - // v5 = not v0 - // jmpif v0 then: b2, else: b1 - // b1(): - // store Field 1 at v4 - // jmp b2() - // b2(): - // v6 = load v4 - // constrain v6 == Field 1 - // return - // } - let ssa = ssa.simplify_cfg(); - - println!("{ssa}"); - - let main = ssa.main(); - assert_eq!(main.reachable_blocks().len(), 3); - - let entry_block = &main.dfg[main.entry_block()]; - - // TODO: more rigorous testing - assert!(matches!( - entry_block.unwrap_terminator(), - TerminatorInstruction::JmpIf { condition, then_destination, else_destination, .. } if *condition == v0 && *then_destination == b2 && *else_destination == b1 - )); + let src = " + acir(inline) fn main f0 { + b0(v0: u1): + v1 = allocate -> &mut Field + store Field 0 at v1 + v3 = not v0 + jmpif v3 then: b1, else: b2 + b1(): + store Field 2 at v1 + jmp b2() + b2(): + v5 = load v1 -> Field + v6 = eq v5, Field 2 + constrain v5 == Field 2 + return + }"; + let ssa = Ssa::from_str(src).unwrap(); + + let expected = " + acir(inline) fn main f0 { + b0(v0: u1): + v1 = allocate -> &mut Field + store Field 0 at v1 + v3 = not v0 + jmpif v0 then: b2, else: b1 + b2(): + v5 = load v1 -> Field + v6 = eq v5, Field 2 + constrain v5 == Field 2 + return + b1(): + store Field 2 at v1 + jmp b2() + }"; + assert_normalized_ssa_equals(ssa.simplify_cfg(), expected); } } From 0acee35425c0f8261c64ad65c6067fa7ee8e716c Mon Sep 17 00:00:00 2001 From: Tom French Date: Tue, 26 Nov 2024 11:10:31 +0000 Subject: [PATCH 08/12] fix: disable optimization in ACIR functions --- .../src/ssa/opt/simplify_cfg.rs | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/compiler/noirc_evaluator/src/ssa/opt/simplify_cfg.rs b/compiler/noirc_evaluator/src/ssa/opt/simplify_cfg.rs index dea7556a851..d7983c53ab6 100644 --- a/compiler/noirc_evaluator/src/ssa/opt/simplify_cfg.rs +++ b/compiler/noirc_evaluator/src/ssa/opt/simplify_cfg.rs @@ -194,6 +194,26 @@ fn check_for_negated_jmpif_condition( block: BasicBlockId, cfg: &mut ControlFlowGraph, ) { + if matches!(function.runtime(), RuntimeType::Acir(_)) { + // Swapping the `then` and `else` branches of a `JmpIf` within an ACIR function + // can result in the situation the branches merge together again in the `then` block, e.g. + // + // acir(inline) fn main f0 { + // b0(v0: u1): + // jmpif v0 then: b2, else: b1 + // b2(): + // return + // b1(): + // jmp b2() + // } + // + // This breaks the `flatten_cfg` pass as it assumes that merges only happen in + // the `else` block or a 3rd block. + // + // See: https://github.com/noir-lang/noir/pull/5891#issuecomment-2500219428 + return; + } + if let Some(TerminatorInstruction::JmpIf { condition, then_destination, From 3fe3a7e00e89ae2bf1bd174d20cedadbe171e183 Mon Sep 17 00:00:00 2001 From: Tom French Date: Tue, 26 Nov 2024 11:28:56 +0000 Subject: [PATCH 09/12] . --- .../src/ssa/opt/flatten_cfg.rs | 56 ------------------- 1 file changed, 56 deletions(-) diff --git a/compiler/noirc_evaluator/src/ssa/opt/flatten_cfg.rs b/compiler/noirc_evaluator/src/ssa/opt/flatten_cfg.rs index 3eeaf21161d..61a93aee58d 100644 --- a/compiler/noirc_evaluator/src/ssa/opt/flatten_cfg.rs +++ b/compiler/noirc_evaluator/src/ssa/opt/flatten_cfg.rs @@ -1463,60 +1463,4 @@ mod test { _ => unreachable!("Should have terminator instruction"), } } - - #[test] - fn correctly_handles_a_negated_jmpif() { - // This program is a regression test for the below program - // - // ```noir - // fn main(x: bool) { - // let mut q = 0; - // - // if x != true { - // q = 2; - // } - // - // assert(q == 2); - // } - // ``` - - let src = " - acir(inline) fn main f0 { - b0(v0: u1): - v1 = allocate -> &mut Field - store Field 0 at v1 - jmpif v0 then: b2, else: b1 - b2(): - v5 = load v1 -> Field - constrain v5 == Field 2 - return - b1(): - store Field 2 at v1 - jmp b2() - } - "; - let ssa = Ssa::from_str(src).unwrap(); - - let ssa = ssa.flatten_cfg(); - let expected = " - acir(inline) fn main f0 { - b0(v0: u1): - v1 = allocate -> &mut Field - store Field 0 at v1 // let q = 0 - enable_side_effects v0 - v3 = load v1 -> Field // 0 - v4 = cast v0 as Field // x - v6 = sub Field 2, v3 // 2 - 0 - v7 = mul v4, v6 // 2 * x - v8 = add v3, v7 // 0 + 2 * x - store v8 at v1 // q = 2 * x <- THIS IS VERY WRONG. This should be q = 2 * !x. - v9 = not v0 - enable_side_effects u1 1 - v11 = load v1 -> Field - constrain v11 == Field 2 - return - } - "; - assert_normalized_ssa_equals(ssa, expected); - } } From c14ed76060a6a68e45cda8686a76968da9c2439d Mon Sep 17 00:00:00 2001 From: Tom French Date: Tue, 26 Nov 2024 11:32:32 +0000 Subject: [PATCH 10/12] . --- .../src/ssa/opt/simplify_cfg.rs | 22 ++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) diff --git a/compiler/noirc_evaluator/src/ssa/opt/simplify_cfg.rs b/compiler/noirc_evaluator/src/ssa/opt/simplify_cfg.rs index d7983c53ab6..64120408d53 100644 --- a/compiler/noirc_evaluator/src/ssa/opt/simplify_cfg.rs +++ b/compiler/noirc_evaluator/src/ssa/opt/simplify_cfg.rs @@ -416,9 +416,9 @@ mod test { } #[test] - fn swap_negated_jmpif_branches() { + fn swap_negated_jmpif_branches_in_brillig() { let src = " - acir(inline) fn main f0 { + brillig(inline) fn main f0 { b0(v0: u1): v1 = allocate -> &mut Field store Field 0 at v1 @@ -436,7 +436,7 @@ mod test { let ssa = Ssa::from_str(src).unwrap(); let expected = " - acir(inline) fn main f0 { + brillig(inline) fn main f0 { b0(v0: u1): v1 = allocate -> &mut Field store Field 0 at v1 @@ -453,4 +453,20 @@ mod test { }"; assert_normalized_ssa_equals(ssa.simplify_cfg(), expected); } + + #[test] + fn does_not_swap_negated_jmpif_branches_in_acir() { + let src = " + acir(inline) fn main f0 { + b0(v0: u1): + v3 = not v0 + jmpif v3 then: b1, else: b2 + b1(): + jmp b2() + b2(): + return + }"; + let ssa = Ssa::from_str(src).unwrap(); + assert_normalized_ssa_equals(ssa.simplify_cfg(), src); + } } From 8fe59dd06582d9f22be2df4ece5c9fb27ee532f3 Mon Sep 17 00:00:00 2001 From: Tom French Date: Tue, 26 Nov 2024 11:56:10 +0000 Subject: [PATCH 11/12] . --- compiler/noirc_evaluator/src/ssa/opt/simplify_cfg.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/compiler/noirc_evaluator/src/ssa/opt/simplify_cfg.rs b/compiler/noirc_evaluator/src/ssa/opt/simplify_cfg.rs index 64120408d53..f5c9e6bfb5d 100644 --- a/compiler/noirc_evaluator/src/ssa/opt/simplify_cfg.rs +++ b/compiler/noirc_evaluator/src/ssa/opt/simplify_cfg.rs @@ -459,8 +459,8 @@ mod test { let src = " acir(inline) fn main f0 { b0(v0: u1): - v3 = not v0 - jmpif v3 then: b1, else: b2 + v1 = not v0 + jmpif v1 then: b1, else: b2 b1(): jmp b2() b2(): From 72892b27454a33ec9163fe5a879a86454d93f34f Mon Sep 17 00:00:00 2001 From: Tom French <15848336+TomAFrench@users.noreply.github.com> Date: Tue, 26 Nov 2024 14:47:29 +0000 Subject: [PATCH 12/12] Update compiler/noirc_evaluator/src/ssa/opt/simplify_cfg.rs Co-authored-by: Maxim Vezenov --- compiler/noirc_evaluator/src/ssa/opt/simplify_cfg.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/compiler/noirc_evaluator/src/ssa/opt/simplify_cfg.rs b/compiler/noirc_evaluator/src/ssa/opt/simplify_cfg.rs index f5c9e6bfb5d..c282e2df451 100644 --- a/compiler/noirc_evaluator/src/ssa/opt/simplify_cfg.rs +++ b/compiler/noirc_evaluator/src/ssa/opt/simplify_cfg.rs @@ -196,7 +196,7 @@ fn check_for_negated_jmpif_condition( ) { if matches!(function.runtime(), RuntimeType::Acir(_)) { // Swapping the `then` and `else` branches of a `JmpIf` within an ACIR function - // can result in the situation the branches merge together again in the `then` block, e.g. + // can result in the situation where the branches merge together again in the `then` block, e.g. // // acir(inline) fn main f0 { // b0(v0: u1):