diff --git a/compiler/noirc_evaluator/src/ssa/opt/flatten_cfg.rs b/compiler/noirc_evaluator/src/ssa/opt/flatten_cfg.rs index 7700c7051ab..8b860a4baee 100644 --- a/compiler/noirc_evaluator/src/ssa/opt/flatten_cfg.rs +++ b/compiler/noirc_evaluator/src/ssa/opt/flatten_cfg.rs @@ -216,7 +216,6 @@ struct Branch { condition: ValueId, last_block: BasicBlockId, store_values: HashMap, - local_allocations: HashSet, } fn flatten_function_cfg(function: &mut Function) { @@ -661,7 +660,6 @@ impl<'f> Context<'f> { // block arguments, it is safe to use the jmpif block here. last_block: jmpif_block, store_values: HashMap::default(), - local_allocations: HashSet::new(), } } else { self.push_condition(jmpif_block, new_condition); @@ -685,13 +683,12 @@ impl<'f> Context<'f> { self.conditions.pop(); let stores_in_branch = std::mem::replace(&mut self.store_values, old_stores); - let local_allocations = std::mem::replace(&mut self.local_allocations, old_allocations); + self.local_allocations = old_allocations; Branch { condition: new_condition, last_block: final_block, store_values: stores_in_branch, - local_allocations, } } } diff --git a/compiler/noirc_evaluator/src/ssa/opt/inlining.rs b/compiler/noirc_evaluator/src/ssa/opt/inlining.rs index 07b524ebc96..617712c9912 100644 --- a/compiler/noirc_evaluator/src/ssa/opt/inlining.rs +++ b/compiler/noirc_evaluator/src/ssa/opt/inlining.rs @@ -88,9 +88,6 @@ struct PerFunctionContext<'function> { /// block. blocks: HashMap, - /// Maps InstructionIds from the function being inlined to the function being inlined into. - instructions: HashMap, - /// True if we're currently working on the entry point function. inlining_entry: bool, } @@ -191,7 +188,6 @@ impl<'function> PerFunctionContext<'function> { context, source_function, blocks: HashMap::default(), - instructions: HashMap::default(), values: HashMap::default(), inlining_entry: false, } diff --git a/compiler/noirc_evaluator/src/ssa/opt/mem2reg.rs b/compiler/noirc_evaluator/src/ssa/opt/mem2reg.rs index 71524ab9736..21c1797ca96 100644 --- a/compiler/noirc_evaluator/src/ssa/opt/mem2reg.rs +++ b/compiler/noirc_evaluator/src/ssa/opt/mem2reg.rs @@ -70,7 +70,6 @@ use crate::ssa::{ ir::{ basic_block::BasicBlockId, cfg::ControlFlowGraph, - dom::DominatorTree, function::Function, function_inserter::FunctionInserter, instruction::{Instruction, InstructionId, TerminatorInstruction}, @@ -100,7 +99,6 @@ impl Ssa { struct PerFunctionContext<'f> { cfg: ControlFlowGraph, post_order: PostOrder, - dom_tree: DominatorTree, blocks: BTreeMap, @@ -117,12 +115,10 @@ impl<'f> PerFunctionContext<'f> { fn new(function: &'f mut Function) -> Self { let cfg = ControlFlowGraph::with_function(function); let post_order = PostOrder::with_function(function); - let dom_tree = DominatorTree::with_cfg_and_post_order(&cfg, &post_order); PerFunctionContext { cfg, post_order, - dom_tree, inserter: FunctionInserter::new(function), blocks: BTreeMap::new(), instructions_to_remove: BTreeSet::new(), diff --git a/compiler/noirc_evaluator/src/ssa/opt/unrolling.rs b/compiler/noirc_evaluator/src/ssa/opt/unrolling.rs index 552d9ef6f4b..50c2f5b1524 100644 --- a/compiler/noirc_evaluator/src/ssa/opt/unrolling.rs +++ b/compiler/noirc_evaluator/src/ssa/opt/unrolling.rs @@ -75,7 +75,6 @@ struct Loops { yet_to_unroll: Vec, modified_blocks: HashSet, cfg: ControlFlowGraph, - dom_tree: DominatorTree, } /// Find a loop in the program by finding a node that dominates any predecessor node. @@ -109,7 +108,6 @@ fn find_all_loops(function: &Function) -> Loops { yet_to_unroll: loops, modified_blocks: HashSet::new(), cfg, - dom_tree, } }