From 54b61d6e1a881b9da56df338ca674986d36f164f Mon Sep 17 00:00:00 2001 From: Camille GILLOT Date: Thu, 19 Oct 2023 16:21:42 +0000 Subject: [PATCH] Reword TO application comments. --- compiler/rustc_mir_transform/src/jump_threading.rs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/compiler/rustc_mir_transform/src/jump_threading.rs b/compiler/rustc_mir_transform/src/jump_threading.rs index 19ba403ec6c..5a5ca6fa870 100644 --- a/compiler/rustc_mir_transform/src/jump_threading.rs +++ b/compiler/rustc_mir_transform/src/jump_threading.rs @@ -639,7 +639,7 @@ impl OpportunitySet { let Some((current, chain)) = op_chain.split_first() else { return }; let basic_blocks = body.basic_blocks.as_mut(); - // Invariant: we never change the meaning of the program. + // Invariant: the control-flow is well-formed at the end of each iteration. let mut current = *current; for &succ in chain { debug!(?current, ?succ); @@ -697,8 +697,9 @@ impl OpportunitySet { new_involved.push((to_index, in_to_index + 1)); } } - // Following TOs new reference `new_succ`, so we will need to update them if we - // duplicate `new_succ` later. + + // The TOs that we just updated now reference `new_succ`. Update `involving_tos` + // in case we need to duplicate an edge starting at `new_succ` later. let _new_succ = self.involving_tos.push(new_involved); debug_assert_eq!(new_succ, _new_succ);