From c09a7e48263c4fc4cb773bef2da2fb8444d6fd01 Mon Sep 17 00:00:00 2001 From: Jake Fecher Date: Tue, 28 Nov 2023 12:26:11 -0600 Subject: [PATCH] Remove abbreviation --- compiler/noirc_evaluator/src/ssa/opt/die.rs | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/compiler/noirc_evaluator/src/ssa/opt/die.rs b/compiler/noirc_evaluator/src/ssa/opt/die.rs index 4995d35a72d..53cdf72bbbf 100644 --- a/compiler/noirc_evaluator/src/ssa/opt/die.rs +++ b/compiler/noirc_evaluator/src/ssa/opt/die.rs @@ -39,7 +39,7 @@ fn dead_instruction_elimination(function: &mut Function) { context.remove_unused_instructions_in_block(function, *block); } - context.remove_inc_rc_instructions(&mut function.dfg); + context.remove_increment_rc_instructions(&mut function.dfg); } /// Per function context for tracking unused values and which instructions to remove. @@ -51,7 +51,7 @@ struct Context { /// IncrementRc instructions must be revisited after the main DIE pass since /// they are technically side-effectful but we stil want to remove them if their /// `value` parameter is not used elsewhere. - inc_rc_instructions: Vec<(InstructionId, BasicBlockId)>, + increment_rc_instructions: Vec<(InstructionId, BasicBlockId)>, } impl Context { @@ -81,7 +81,7 @@ impl Context { let instruction = &function.dfg[*instruction_id]; if let Instruction::IncrementRc { .. } = instruction { - self.inc_rc_instructions.push((*instruction_id, block_id)); + self.increment_rc_instructions.push((*instruction_id, block_id)); } else { instruction.for_each_value(|value| { self.mark_used_instruction_results(&function.dfg, value); @@ -140,16 +140,16 @@ impl Context { } } - fn remove_inc_rc_instructions(self, dfg: &mut DataFlowGraph) { - for (inc_rc, block) in self.inc_rc_instructions { - let value = match &dfg[inc_rc] { + fn remove_increment_rc_instructions(self, dfg: &mut DataFlowGraph) { + for (increment_rc, block) in self.increment_rc_instructions { + let value = match &dfg[increment_rc] { Instruction::IncrementRc { value } => *value, other => unreachable!("Expected IncrementRc instruction, found {other:?}"), }; - // This could be more efficient if we have to remove multiple inc_rcs in a single block + // This could be more efficient if we have to remove multiple IncrementRcs in a single block if !self.used_values.contains(&value) { - dfg[block].instructions_mut().retain(|instruction| *instruction != inc_rc); + dfg[block].instructions_mut().retain(|instruction| *instruction != increment_rc); } } }