From fd87ec7cdd4c37c646793e815cd183053b03cea5 Mon Sep 17 00:00:00 2001 From: zhiyuan yan Date: Fri, 7 Jun 2024 14:41:11 -0700 Subject: [PATCH] fix missing context_cache --- src/util.rs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/util.rs b/src/util.rs index 56877ab9..75ae519a 100644 --- a/src/util.rs +++ b/src/util.rs @@ -624,7 +624,7 @@ impl Run { } RunType::PrettyPrint => { let rvsdg = Optimizer::program_to_rvsdg(&self.prog_with_args.program)?; - let dag = rvsdg.to_dag_encoding(true); + let (dag, _) = rvsdg.to_dag_encoding(true); let res = TreeProgram::pretty_print_to_rust(&dag); ( vec![Visualization { @@ -637,8 +637,8 @@ impl Run { } RunType::OptimizedPrettyPrint => { let rvsdg = Optimizer::program_to_rvsdg(&self.prog_with_args.program)?; - let dag = rvsdg.to_dag_encoding(true); - let optimized = dag_in_context::optimize(&dag).map_err(EggCCError::EggLog)?; + let (prog, mut ctx_cache) = rvsdg.to_dag_encoding(true); + let optimized = dag_in_context::optimize(&prog, &mut ctx_cache).map_err(EggCCError::EggLog)?; let res = TreeProgram::pretty_print_to_rust(&optimized); ( vec![Visualization { @@ -652,8 +652,8 @@ impl Run { RunType::TestPrettyPrint => { let rvsdg = crate::Optimizer::program_to_rvsdg(&self.prog_with_args.program).unwrap(); - let tree = rvsdg.to_dag_encoding(true); - let unfolded_program = build_program(&tree, false); + let (tree, mut cache) = rvsdg.to_dag_encoding(true); + let unfolded_program = build_program(&tree, &mut cache, false); let folded_program = tree.pretty_print_to_egglog(); let program = format!("{unfolded_program} \n {folded_program} \n (check (= PROG_PP PROG))");