Skip to content

Commit 53f772c

Browse files
authored
Merge pull request #77582 from eeckstein/fix-comment
GuaranteedPhiUpdater: fix a comment
2 parents eb8d9f4 + 2182f44 commit 53f772c

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

SwiftCompilerSources/Sources/Optimizer/Utilities/GuaranteedPhiUpdater.swift

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -85,11 +85,12 @@ func updateReborrowFlags(in function: Function, _ context: some MutatingContext)
8585
}
8686

8787
/// Updates the reborrow flags for all `phis`.
88+
///
89+
/// Re-borrow flags are only set, but never cleared. If an optimization creates a dead-end block
90+
/// by cutting off the control flow before an `end_borrow`, the re-borrow flags still have to remain
91+
/// without the possibility to re-calculate them from the (now missing) `end_borrow`.
92+
///
8893
func updateReborrowFlags(for phis: some Sequence<Phi>, _ context: some MutatingContext) {
89-
// TODO: clear reborrow flags before re-computing when we have complete OSSA lifetimes.
90-
// It would be cleaner to first clear all flags. But this is not possible because some end_borrow instructions
91-
// might be missing in dead-end blocks. This will be fixed with complete OSSA lifetimes.
92-
9394
if let phi = phis.first(where: { phi in true }), !phi.value.parentFunction.hasOwnership {
9495
return
9596
}

0 commit comments

Comments
 (0)