diff options
| author | Camille GILLOT <gillot.camille@gmail.com> | 2023-10-19 16:21:42 +0000 |
|---|---|---|
| committer | Camille GILLOT <gillot.camille@gmail.com> | 2023-10-21 07:08:53 +0000 |
| commit | 54b61d6e1a881b9da56df338ca674986d36f164f (patch) | |
| tree | 9ddb7c199aeed604ff27a6dc26ec26719f342594 /compiler/rustc_mir_transform/src/jump_threading.rs | |
| parent | 66ec098ea7804ce8d02275cd754ccdcd7813bfdf (diff) | |
| download | rust-54b61d6e1a881b9da56df338ca674986d36f164f.tar.gz rust-54b61d6e1a881b9da56df338ca674986d36f164f.zip | |
Reword TO application comments.
Diffstat (limited to 'compiler/rustc_mir_transform/src/jump_threading.rs')
| -rw-r--r-- | compiler/rustc_mir_transform/src/jump_threading.rs | 7 |
1 files 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); |
