From 7caf0826ef4239ee5faaf96cc388052dd26ea0b6 Mon Sep 17 00:00:00 2001 From: ethan-000 Date: Thu, 17 Aug 2023 14:40:03 +0100 Subject: [PATCH 1/5] remove intrinsic::println --- .../noirc_evaluator/src/ssa/acir_gen/mod.rs | 2 - .../noirc_evaluator/src/ssa/ir/instruction.rs | 5 +- .../src/ssa/ir/instruction/call.rs | 1 - crates/noirc_evaluator/src/ssa/opt/die.rs | 12 ++--- .../src/ssa/opt/flatten_cfg.rs | 54 +++++++++---------- .../noirc_evaluator/src/ssa/opt/inlining.rs | 10 ++-- crates/noirc_evaluator/src/ssa/opt/mem2reg.rs | 6 ++- 7 files changed, 43 insertions(+), 47 deletions(-) diff --git a/crates/noirc_evaluator/src/ssa/acir_gen/mod.rs b/crates/noirc_evaluator/src/ssa/acir_gen/mod.rs index 96ff3acc426..d108a5042e7 100644 --- a/crates/noirc_evaluator/src/ssa/acir_gen/mod.rs +++ b/crates/noirc_evaluator/src/ssa/acir_gen/mod.rs @@ -993,8 +993,6 @@ impl Context { self.acir_context.bit_decompose(endian, field, bit_size, result_type) } - // TODO(#2115): Remove the println intrinsic as the oracle println is now used instead - Intrinsic::Println => Ok(Vec::new()), Intrinsic::Sort => { let inputs = vecmap(arguments, |arg| self.convert_value(*arg, dfg)); // We flatten the inputs and retrieve the bit_size of the elements diff --git a/crates/noirc_evaluator/src/ssa/ir/instruction.rs b/crates/noirc_evaluator/src/ssa/ir/instruction.rs index 8f3cd0cfe3c..6b68b0f85a4 100644 --- a/crates/noirc_evaluator/src/ssa/ir/instruction.rs +++ b/crates/noirc_evaluator/src/ssa/ir/instruction.rs @@ -41,7 +41,6 @@ pub(crate) enum Intrinsic { SliceInsert, SliceRemove, StrAsBytes, - Println, ToBits(Endian), ToRadix(Endian), BlackBox(BlackBoxFunc), @@ -50,7 +49,6 @@ pub(crate) enum Intrinsic { impl std::fmt::Display for Intrinsic { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { match self { - Intrinsic::Println => write!(f, "println"), Intrinsic::Sort => write!(f, "arraysort"), Intrinsic::ArrayLen => write!(f, "array_len"), Intrinsic::AssertConstant => write!(f, "assert_constant"), @@ -76,7 +74,7 @@ impl Intrinsic { /// If there are no side effects then the `Intrinsic` can be removed if the result is unused. pub(crate) fn has_side_effects(&self) -> bool { match self { - Intrinsic::Println | Intrinsic::AssertConstant => true, + Intrinsic::AssertConstant => true, Intrinsic::Sort | Intrinsic::ArrayLen @@ -99,7 +97,6 @@ impl Intrinsic { /// If there is no such intrinsic by that name, None is returned. pub(crate) fn lookup(name: &str) -> Option { match name { - "println" => Some(Intrinsic::Println), "arraysort" => Some(Intrinsic::Sort), "array_len" => Some(Intrinsic::ArrayLen), "assert_constant" => Some(Intrinsic::AssertConstant), diff --git a/crates/noirc_evaluator/src/ssa/ir/instruction/call.rs b/crates/noirc_evaluator/src/ssa/ir/instruction/call.rs index e73ff02ba08..7eab8fc2eef 100644 --- a/crates/noirc_evaluator/src/ssa/ir/instruction/call.rs +++ b/crates/noirc_evaluator/src/ssa/ir/instruction/call.rs @@ -178,7 +178,6 @@ pub(super) fn simplify_call( } Intrinsic::BlackBox(bb_func) => simplify_black_box_func(bb_func, arguments, dfg), Intrinsic::Sort => simplify_sort(dfg, arguments), - Intrinsic::Println => SimplifyResult::None, } } diff --git a/crates/noirc_evaluator/src/ssa/opt/die.rs b/crates/noirc_evaluator/src/ssa/opt/die.rs index ee78fa82256..226fa3d9d0e 100644 --- a/crates/noirc_evaluator/src/ssa/opt/die.rs +++ b/crates/noirc_evaluator/src/ssa/opt/die.rs @@ -131,7 +131,7 @@ mod test { use crate::ssa::{ ir::{ function::RuntimeType, - instruction::{BinaryOp, Intrinsic}, + instruction::{BinaryOp, Endian::Little, Intrinsic}, map::Id, types::Type, }, @@ -155,7 +155,7 @@ mod test { // v9 = add v7, Field 2 // v10 = add v7, Field 3 // v11 = add v10, v10 - // call println(v8) + // call to_le_bits(v8) // return v9 // } let main_id = Id::test_new(0); @@ -187,8 +187,8 @@ mod test { let v10 = builder.insert_binary(v7, BinaryOp::Add, three); let _v11 = builder.insert_binary(v10, BinaryOp::Add, v10); - let println_id = builder.import_intrinsic_id(Intrinsic::Println); - builder.insert_call(println_id, vec![v8], vec![]); + let to_le_bits_id = builder.import_intrinsic_id(Intrinsic::ToBits(Little)); + builder.insert_call(to_le_bits_id, vec![v8], vec![]); builder.terminate_with_return(vec![v9]); let ssa = builder.finish(); @@ -210,13 +210,13 @@ mod test { // v7 = load v6 // v8 = add v7, Field 1 // v9 = add v7, Field 2 - // call println(v8) + // call to_le_bits(v8) // return v9 // } let ssa = ssa.dead_instruction_elimination(); let main = ssa.main(); assert_eq!(main.dfg[main.entry_block()].instructions().len(), 1); - assert_eq!(main.dfg[b1].instructions().len(), 6); + assert_eq!(main.dfg[b1].instructions().len(), 4); } } diff --git a/crates/noirc_evaluator/src/ssa/opt/flatten_cfg.rs b/crates/noirc_evaluator/src/ssa/opt/flatten_cfg.rs index 3df27868737..51866fc791e 100644 --- a/crates/noirc_evaluator/src/ssa/opt/flatten_cfg.rs +++ b/crates/noirc_evaluator/src/ssa/opt/flatten_cfg.rs @@ -1040,54 +1040,54 @@ mod test { builder.insert_store(r1, value); }; - let println = builder.import_intrinsic_id(Intrinsic::Println); + let sort = builder.import_intrinsic_id(Intrinsic::Sort); - let call_println = |builder: &mut FunctionBuilder, block: u128| { + let call_sort = |builder: &mut FunctionBuilder, block: u128| { let block = builder.field_constant(block); let load = builder.insert_load(r1, Type::field()); - builder.insert_call(println, vec![block, load], Vec::new()); + builder.insert_call(sort, vec![block, load], Vec::new()); }; - let switch_store_and_print = |builder: &mut FunctionBuilder, block, block_number: u128| { + let switch_store_and_sort = |builder: &mut FunctionBuilder, block, block_number: u128| { builder.switch_to_block(block); store_value(builder, block_number); - call_println(builder, block_number); + call_sort(builder, block_number); }; - let switch_and_print = |builder: &mut FunctionBuilder, block, block_number: u128| { + let switch_and_sort = |builder: &mut FunctionBuilder, block, block_number: u128| { builder.switch_to_block(block); - call_println(builder, block_number); + call_sort(builder, block_number); }; store_value(&mut builder, 0); - call_println(&mut builder, 0); + call_sort(&mut builder, 0); builder.terminate_with_jmp(b1, vec![]); - switch_store_and_print(&mut builder, b1, 1); + switch_store_and_sort(&mut builder, b1, 1); builder.terminate_with_jmpif(c1, b2, b3); - switch_store_and_print(&mut builder, b2, 2); + switch_store_and_sort(&mut builder, b2, 2); builder.terminate_with_jmp(b4, vec![]); - switch_store_and_print(&mut builder, b3, 3); + switch_store_and_sort(&mut builder, b3, 3); builder.terminate_with_jmp(b8, vec![]); - switch_and_print(&mut builder, b4, 4); + switch_and_sort(&mut builder, b4, 4); builder.terminate_with_jmpif(c4, b5, b6); - switch_store_and_print(&mut builder, b5, 5); + switch_store_and_sort(&mut builder, b5, 5); builder.terminate_with_jmp(b7, vec![]); - switch_store_and_print(&mut builder, b6, 6); + switch_store_and_sort(&mut builder, b6, 6); builder.terminate_with_jmp(b7, vec![]); - switch_and_print(&mut builder, b7, 7); + switch_and_sort(&mut builder, b7, 7); builder.terminate_with_jmp(b9, vec![]); - switch_and_print(&mut builder, b8, 8); + switch_and_sort(&mut builder, b8, 8); builder.terminate_with_jmp(b9, vec![]); - switch_and_print(&mut builder, b9, 9); + switch_and_sort(&mut builder, b9, 9); let load = builder.insert_load(r1, Type::field()); builder.terminate_with_return(vec![load]); @@ -1097,18 +1097,18 @@ mod test { // // fn main f0 { // b0(v0: u1, v1: u1): - // call println(Field 0, Field 0) - // call println(Field 1, Field 1) + // call sort(Field 0, Field 0) + // call sort(Field 1, Field 1) // enable_side_effects v0 - // call println(Field 2, Field 2) - // call println(Field 4, Field 2) + // call sort(Field 2, Field 2) + // call sort(Field 4, Field 2) // v29 = and v0, v1 // enable_side_effects v29 - // call println(Field 5, Field 5) + // call sort(Field 5, Field 5) // v32 = not v1 // v33 = and v0, v32 // enable_side_effects v33 - // call println(Field 6, Field 6) + // call sort(Field 6, Field 6) // enable_side_effects v0 // v36 = mul v1, Field 5 // v37 = mul v32, Field 2 @@ -1116,12 +1116,12 @@ mod test { // v39 = mul v1, Field 5 // v40 = mul v32, Field 6 // v41 = add v39, v40 - // call println(Field 7, v42) + // call sort(Field 7, v42) // v43 = not v0 // enable_side_effects v43 // store Field 3 at v2 - // call println(Field 3, Field 3) - // call println(Field 8, Field 3) + // call sort(Field 3, Field 3) + // call sort(Field 8, Field 3) // enable_side_effects Field 1 // v47 = mul v0, v41 // v48 = mul v43, Field 1 @@ -1129,7 +1129,7 @@ mod test { // v50 = mul v0, v44 // v51 = mul v43, Field 3 // v52 = add v50, v51 - // call println(Field 9, v53) + // call sort(Field 9, v53) // return v54 // } diff --git a/crates/noirc_evaluator/src/ssa/opt/inlining.rs b/crates/noirc_evaluator/src/ssa/opt/inlining.rs index cf7b5860ea6..10bafe93473 100644 --- a/crates/noirc_evaluator/src/ssa/opt/inlining.rs +++ b/crates/noirc_evaluator/src/ssa/opt/inlining.rs @@ -516,7 +516,7 @@ mod test { ir::{ basic_block::BasicBlockId, function::RuntimeType, - instruction::{BinaryOp, Intrinsic, TerminatorInstruction}, + instruction::{BinaryOp, Endian::Little, Intrinsic, TerminatorInstruction}, map::Id, types::Type, }, @@ -721,7 +721,7 @@ mod test { // fn main f0 { // b0(v0: u1): // v2 = call f1(v0) - // call println(v2) + // call to_le_bits(v2) // return // } // fn inner1 f1 { @@ -746,8 +746,8 @@ mod test { let inner1_id = Id::test_new(1); let inner1 = builder.import_function(inner1_id); let main_v2 = builder.insert_call(inner1, vec![main_cond], vec![Type::field()])[0]; - let println = builder.import_intrinsic_id(Intrinsic::Println); - builder.insert_call(println, vec![main_v2], vec![]); + let to_le_bits = builder.import_intrinsic_id(Intrinsic::ToBits(Little)); + builder.insert_call(to_le_bits, vec![main_v2], vec![]); builder.terminate_with_return(vec![]); builder.new_function("inner1".into(), inner1_id); @@ -781,7 +781,7 @@ mod test { // b1(): // jmp b3(Field 1) // b3(v3: Field): - // call println(v3) + // call to_le_bits(v3) // return // b2(): // jmp b3(Field 2) diff --git a/crates/noirc_evaluator/src/ssa/opt/mem2reg.rs b/crates/noirc_evaluator/src/ssa/opt/mem2reg.rs index be0ded802b3..d82f43e0a30 100644 --- a/crates/noirc_evaluator/src/ssa/opt/mem2reg.rs +++ b/crates/noirc_evaluator/src/ssa/opt/mem2reg.rs @@ -388,7 +388,9 @@ mod tests { basic_block::BasicBlockId, dfg::DataFlowGraph, function::RuntimeType, - instruction::{BinaryOp, Instruction, Intrinsic, TerminatorInstruction}, + instruction::{ + BinaryOp, Endian::Little, Instruction, Intrinsic, TerminatorInstruction, + }, map::Id, types::Type, }, @@ -455,7 +457,7 @@ mod tests { let one = builder.field_constant(FieldElement::one()); builder.insert_store(v0, one); let v1 = builder.insert_load(v0, Type::field()); - let f0 = builder.import_intrinsic_id(Intrinsic::Println); + let f0 = builder.import_intrinsic_id(Intrinsic::ToBits(Little)); builder.insert_call(f0, vec![v0], vec![]); builder.terminate_with_return(vec![v1]); From 6448cc6deb7a49386293115a7a94696839606287 Mon Sep 17 00:00:00 2001 From: ethan-000 Date: Thu, 17 Aug 2023 15:50:17 +0100 Subject: [PATCH 2/5] review --- crates/noirc_evaluator/src/ssa/opt/die.rs | 10 +-- .../src/ssa/opt/flatten_cfg.rs | 66 ++++++++++--------- crates/noirc_evaluator/src/ssa/opt/mem2reg.rs | 6 +- 3 files changed, 41 insertions(+), 41 deletions(-) diff --git a/crates/noirc_evaluator/src/ssa/opt/die.rs b/crates/noirc_evaluator/src/ssa/opt/die.rs index 226fa3d9d0e..e514c013535 100644 --- a/crates/noirc_evaluator/src/ssa/opt/die.rs +++ b/crates/noirc_evaluator/src/ssa/opt/die.rs @@ -131,7 +131,7 @@ mod test { use crate::ssa::{ ir::{ function::RuntimeType, - instruction::{BinaryOp, Endian::Little, Intrinsic}, + instruction::{BinaryOp, Intrinsic}, map::Id, types::Type, }, @@ -155,7 +155,7 @@ mod test { // v9 = add v7, Field 2 // v10 = add v7, Field 3 // v11 = add v10, v10 - // call to_le_bits(v8) + // call assert_constant(v8) // return v9 // } let main_id = Id::test_new(0); @@ -187,7 +187,7 @@ mod test { let v10 = builder.insert_binary(v7, BinaryOp::Add, three); let _v11 = builder.insert_binary(v10, BinaryOp::Add, v10); - let to_le_bits_id = builder.import_intrinsic_id(Intrinsic::ToBits(Little)); + let to_le_bits_id = builder.import_intrinsic_id(Intrinsic::AssertConstant); builder.insert_call(to_le_bits_id, vec![v8], vec![]); builder.terminate_with_return(vec![v9]); @@ -210,13 +210,13 @@ mod test { // v7 = load v6 // v8 = add v7, Field 1 // v9 = add v7, Field 2 - // call to_le_bits(v8) + // call assert_constant(v8) // return v9 // } let ssa = ssa.dead_instruction_elimination(); let main = ssa.main(); assert_eq!(main.dfg[main.entry_block()].instructions().len(), 1); - assert_eq!(main.dfg[b1].instructions().len(), 4); + assert_eq!(main.dfg[b1].instructions().len(), 6); } } diff --git a/crates/noirc_evaluator/src/ssa/opt/flatten_cfg.rs b/crates/noirc_evaluator/src/ssa/opt/flatten_cfg.rs index 51866fc791e..6e5664fa837 100644 --- a/crates/noirc_evaluator/src/ssa/opt/flatten_cfg.rs +++ b/crates/noirc_evaluator/src/ssa/opt/flatten_cfg.rs @@ -1040,54 +1040,56 @@ mod test { builder.insert_store(r1, value); }; - let sort = builder.import_intrinsic_id(Intrinsic::Sort); + let test_function = Id::test_new(1); - let call_sort = |builder: &mut FunctionBuilder, block: u128| { + let call_test_function = |builder: &mut FunctionBuilder, block: u128| { let block = builder.field_constant(block); let load = builder.insert_load(r1, Type::field()); - builder.insert_call(sort, vec![block, load], Vec::new()); + builder.insert_call(test_function, vec![block, load], Vec::new()); }; - let switch_store_and_sort = |builder: &mut FunctionBuilder, block, block_number: u128| { - builder.switch_to_block(block); - store_value(builder, block_number); - call_sort(builder, block_number); - }; + let switch_store_and_test_function = + |builder: &mut FunctionBuilder, block, block_number: u128| { + builder.switch_to_block(block); + store_value(builder, block_number); + call_test_function(builder, block_number); + }; - let switch_and_sort = |builder: &mut FunctionBuilder, block, block_number: u128| { - builder.switch_to_block(block); - call_sort(builder, block_number); - }; + let switch_and_test_function = + |builder: &mut FunctionBuilder, block, block_number: u128| { + builder.switch_to_block(block); + call_test_function(builder, block_number); + }; store_value(&mut builder, 0); - call_sort(&mut builder, 0); + call_test_function(&mut builder, 0); builder.terminate_with_jmp(b1, vec![]); - switch_store_and_sort(&mut builder, b1, 1); + switch_store_and_test_function(&mut builder, b1, 1); builder.terminate_with_jmpif(c1, b2, b3); - switch_store_and_sort(&mut builder, b2, 2); + switch_store_and_test_function(&mut builder, b2, 2); builder.terminate_with_jmp(b4, vec![]); - switch_store_and_sort(&mut builder, b3, 3); + switch_store_and_test_function(&mut builder, b3, 3); builder.terminate_with_jmp(b8, vec![]); - switch_and_sort(&mut builder, b4, 4); + switch_and_test_function(&mut builder, b4, 4); builder.terminate_with_jmpif(c4, b5, b6); - switch_store_and_sort(&mut builder, b5, 5); + switch_store_and_test_function(&mut builder, b5, 5); builder.terminate_with_jmp(b7, vec![]); - switch_store_and_sort(&mut builder, b6, 6); + switch_store_and_test_function(&mut builder, b6, 6); builder.terminate_with_jmp(b7, vec![]); - switch_and_sort(&mut builder, b7, 7); + switch_and_test_function(&mut builder, b7, 7); builder.terminate_with_jmp(b9, vec![]); - switch_and_sort(&mut builder, b8, 8); + switch_and_test_function(&mut builder, b8, 8); builder.terminate_with_jmp(b9, vec![]); - switch_and_sort(&mut builder, b9, 9); + switch_and_test_function(&mut builder, b9, 9); let load = builder.insert_load(r1, Type::field()); builder.terminate_with_return(vec![load]); @@ -1097,18 +1099,18 @@ mod test { // // fn main f0 { // b0(v0: u1, v1: u1): - // call sort(Field 0, Field 0) - // call sort(Field 1, Field 1) + // call test_function(Field 0, Field 0) + // call test_function(Field 1, Field 1) // enable_side_effects v0 - // call sort(Field 2, Field 2) - // call sort(Field 4, Field 2) + // call test_function(Field 2, Field 2) + // call test_function(Field 4, Field 2) // v29 = and v0, v1 // enable_side_effects v29 - // call sort(Field 5, Field 5) + // call test_function(Field 5, Field 5) // v32 = not v1 // v33 = and v0, v32 // enable_side_effects v33 - // call sort(Field 6, Field 6) + // call test_function(Field 6, Field 6) // enable_side_effects v0 // v36 = mul v1, Field 5 // v37 = mul v32, Field 2 @@ -1116,12 +1118,12 @@ mod test { // v39 = mul v1, Field 5 // v40 = mul v32, Field 6 // v41 = add v39, v40 - // call sort(Field 7, v42) + // call test_function(Field 7, v42) // v43 = not v0 // enable_side_effects v43 // store Field 3 at v2 - // call sort(Field 3, Field 3) - // call sort(Field 8, Field 3) + // call test_function(Field 3, Field 3) + // call test_function(Field 8, Field 3) // enable_side_effects Field 1 // v47 = mul v0, v41 // v48 = mul v43, Field 1 @@ -1129,7 +1131,7 @@ mod test { // v50 = mul v0, v44 // v51 = mul v43, Field 3 // v52 = add v50, v51 - // call sort(Field 9, v53) + // call test_function(Field 9, v53) // return v54 // } diff --git a/crates/noirc_evaluator/src/ssa/opt/mem2reg.rs b/crates/noirc_evaluator/src/ssa/opt/mem2reg.rs index d82f43e0a30..d83cda4a8b1 100644 --- a/crates/noirc_evaluator/src/ssa/opt/mem2reg.rs +++ b/crates/noirc_evaluator/src/ssa/opt/mem2reg.rs @@ -388,9 +388,7 @@ mod tests { basic_block::BasicBlockId, dfg::DataFlowGraph, function::RuntimeType, - instruction::{ - BinaryOp, Endian::Little, Instruction, Intrinsic, TerminatorInstruction, - }, + instruction::{BinaryOp, Instruction, Intrinsic, TerminatorInstruction}, map::Id, types::Type, }, @@ -457,7 +455,7 @@ mod tests { let one = builder.field_constant(FieldElement::one()); builder.insert_store(v0, one); let v1 = builder.insert_load(v0, Type::field()); - let f0 = builder.import_intrinsic_id(Intrinsic::ToBits(Little)); + let f0 = builder.import_intrinsic_id(Intrinsic::AssertConstant); builder.insert_call(f0, vec![v0], vec![]); builder.terminate_with_return(vec![v1]); From 95502a66acc87e712c97eadb7ff9ad9fb5865cd1 Mon Sep 17 00:00:00 2001 From: ethan-000 Date: Thu, 17 Aug 2023 15:50:56 +0100 Subject: [PATCH 3/5] review --- crates/noirc_evaluator/src/ssa/opt/flatten_cfg.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/crates/noirc_evaluator/src/ssa/opt/flatten_cfg.rs b/crates/noirc_evaluator/src/ssa/opt/flatten_cfg.rs index 6e5664fa837..e99a46186e6 100644 --- a/crates/noirc_evaluator/src/ssa/opt/flatten_cfg.rs +++ b/crates/noirc_evaluator/src/ssa/opt/flatten_cfg.rs @@ -1000,8 +1000,8 @@ mod test { // will store values. Other blocks do not store values so that we can test // how these existing values are merged at each join point. // - // For debugging purposes, each block also has a call to println with two - // arguments. The first is the block the println was originally in, and the + // For debugging purposes, each block also has a call to test_function with two + // arguments. The first is the block the test_function was originally in, and the // second is the current value stored in the reference. // // b0 (0 stored) From 8523dcff2b7678e05600145e79fd55ab54f2806f Mon Sep 17 00:00:00 2001 From: ethan-000 Date: Thu, 17 Aug 2023 15:51:58 +0100 Subject: [PATCH 4/5] . --- crates/noirc_evaluator/src/ssa/opt/die.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/crates/noirc_evaluator/src/ssa/opt/die.rs b/crates/noirc_evaluator/src/ssa/opt/die.rs index e514c013535..47b94741266 100644 --- a/crates/noirc_evaluator/src/ssa/opt/die.rs +++ b/crates/noirc_evaluator/src/ssa/opt/die.rs @@ -187,8 +187,8 @@ mod test { let v10 = builder.insert_binary(v7, BinaryOp::Add, three); let _v11 = builder.insert_binary(v10, BinaryOp::Add, v10); - let to_le_bits_id = builder.import_intrinsic_id(Intrinsic::AssertConstant); - builder.insert_call(to_le_bits_id, vec![v8], vec![]); + let assert_constant_id = builder.import_intrinsic_id(Intrinsic::AssertConstant); + builder.insert_call(assert_constant_id, vec![v8], vec![]); builder.terminate_with_return(vec![v9]); let ssa = builder.finish(); From 46c50ce152e4166ebf6b00f9589b6eb2b07b364e Mon Sep 17 00:00:00 2001 From: ethan-000 Date: Thu, 17 Aug 2023 15:53:59 +0100 Subject: [PATCH 5/5] . --- crates/noirc_evaluator/src/ssa/opt/inlining.rs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/crates/noirc_evaluator/src/ssa/opt/inlining.rs b/crates/noirc_evaluator/src/ssa/opt/inlining.rs index 10bafe93473..55424f8f32f 100644 --- a/crates/noirc_evaluator/src/ssa/opt/inlining.rs +++ b/crates/noirc_evaluator/src/ssa/opt/inlining.rs @@ -516,7 +516,7 @@ mod test { ir::{ basic_block::BasicBlockId, function::RuntimeType, - instruction::{BinaryOp, Endian::Little, Intrinsic, TerminatorInstruction}, + instruction::{BinaryOp, Intrinsic, TerminatorInstruction}, map::Id, types::Type, }, @@ -721,7 +721,7 @@ mod test { // fn main f0 { // b0(v0: u1): // v2 = call f1(v0) - // call to_le_bits(v2) + // call assert_constant(v2) // return // } // fn inner1 f1 { @@ -746,8 +746,8 @@ mod test { let inner1_id = Id::test_new(1); let inner1 = builder.import_function(inner1_id); let main_v2 = builder.insert_call(inner1, vec![main_cond], vec![Type::field()])[0]; - let to_le_bits = builder.import_intrinsic_id(Intrinsic::ToBits(Little)); - builder.insert_call(to_le_bits, vec![main_v2], vec![]); + let assert_constant = builder.import_intrinsic_id(Intrinsic::AssertConstant); + builder.insert_call(assert_constant, vec![main_v2], vec![]); builder.terminate_with_return(vec![]); builder.new_function("inner1".into(), inner1_id); @@ -781,7 +781,7 @@ mod test { // b1(): // jmp b3(Field 1) // b3(v3: Field): - // call to_le_bits(v3) + // call assert_constant(v3) // return // b2(): // jmp b3(Field 2)