From 594aad21f30614b1733a3ba2b8a2a5f5d7b7e119 Mon Sep 17 00:00:00 2001 From: Aztec Bot <49558828+AztecBot@users.noreply.github.com> Date: Fri, 29 Nov 2024 10:03:04 -0500 Subject: [PATCH] feat: Sync from aztec-packages (#6656) Co-authored-by: Ary Borenszweig Co-authored-by: Tom French <15848336+TomAFrench@users.noreply.github.com> Co-authored-by: TomAFrench --- .aztec-sync-commit | 2 +- .../src/ssa/ssa_gen/context.rs | 3 --- .../profiler/src/cli/gates_flamegraph_cmd.rs | 25 ++++++++++++++++--- 3 files changed, 22 insertions(+), 8 deletions(-) diff --git a/.aztec-sync-commit b/.aztec-sync-commit index d97a936c081..477ebbca903 100644 --- a/.aztec-sync-commit +++ b/.aztec-sync-commit @@ -1 +1 @@ -1bfc15e08873a1f0f3743e259f418b70426b3f25 +0577c1a70e9746bd06f07d2813af1be39e01ca02 diff --git a/compiler/noirc_evaluator/src/ssa/ssa_gen/context.rs b/compiler/noirc_evaluator/src/ssa/ssa_gen/context.rs index ddc3365b551..e39eed79021 100644 --- a/compiler/noirc_evaluator/src/ssa/ssa_gen/context.rs +++ b/compiler/noirc_evaluator/src/ssa/ssa_gen/context.rs @@ -733,9 +733,6 @@ impl<'a> FunctionContext<'a> { let element_types = Self::convert_type(element_type); values.map_both(element_types, |value, element_type| { let reference = value.eval_reference(); - // Reference counting in brillig relies on us incrementing reference - // counts when arrays/slices are constructed or indexed. - // Thus, if we dereference an lvalue which happens to be array/slice we should increment its reference counter. self.builder.insert_load(reference, element_type).into() }) } diff --git a/tooling/profiler/src/cli/gates_flamegraph_cmd.rs b/tooling/profiler/src/cli/gates_flamegraph_cmd.rs index c3ae29de058..e68a8cd5bd2 100644 --- a/tooling/profiler/src/cli/gates_flamegraph_cmd.rs +++ b/tooling/profiler/src/cli/gates_flamegraph_cmd.rs @@ -31,6 +31,10 @@ pub(crate) struct GatesFlamegraphCommand { /// The output folder for the flamegraph svg files #[clap(long, short)] output: String, + + /// The output name for the flamegraph svg files + #[clap(long, short = 'f')] + output_filename: Option, } pub(crate) fn run(args: GatesFlamegraphCommand) -> eyre::Result<()> { @@ -43,6 +47,7 @@ pub(crate) fn run(args: GatesFlamegraphCommand) -> eyre::Result<()> { }, &InfernoFlamegraphGenerator { count_name: "gates".to_string() }, &PathBuf::from(args.output), + args.output_filename, ) } @@ -51,6 +56,7 @@ fn run_with_provider( gates_provider: &Provider, flamegraph_generator: &Generator, output_path: &Path, + output_filename: Option, ) -> eyre::Result<()> { let mut program = read_program_from_file(artifact_path).context("Error reading program from file")?; @@ -91,13 +97,18 @@ fn run_with_provider( }) .collect(); + let output_filename = if let Some(output_filename) = &output_filename { + format!("{}::{}::gates.svg", output_filename, func_name) + } else { + format!("{}::gates.svg", func_name) + }; flamegraph_generator.generate_flamegraph( samples, &debug_artifact.debug_symbols[func_idx], &debug_artifact, artifact_path.to_str().unwrap(), &func_name, - &Path::new(&output_path).join(Path::new(&format!("{}_gates.svg", &func_name))), + &Path::new(&output_path).join(Path::new(&output_filename)), )?; } @@ -189,11 +200,17 @@ mod tests { }; let flamegraph_generator = TestFlamegraphGenerator::default(); - super::run_with_provider(&artifact_path, &provider, &flamegraph_generator, temp_dir.path()) - .expect("should run without errors"); + super::run_with_provider( + &artifact_path, + &provider, + &flamegraph_generator, + temp_dir.path(), + Some(String::from("test_filename")), + ) + .expect("should run without errors"); // Check that the output file was written to - let output_file = temp_dir.path().join("main_gates.svg"); + let output_file = temp_dir.path().join("test_filename::main::gates.svg"); assert!(output_file.exists()); } }