Skip to content

GuaranteedPhiUpdater: fix a comment #77582

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Nov 13, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -85,11 +85,12 @@ func updateReborrowFlags(in function: Function, _ context: some MutatingContext)
}

/// Updates the reborrow flags for all `phis`.
///
/// Re-borrow flags are only set, but never cleared. If an optimization creates a dead-end block
/// by cutting off the control flow before an `end_borrow`, the re-borrow flags still have to remain
/// without the possibility to re-calculate them from the (now missing) `end_borrow`.
///
func updateReborrowFlags(for phis: some Sequence<Phi>, _ context: some MutatingContext) {
// TODO: clear reborrow flags before re-computing when we have complete OSSA lifetimes.
// It would be cleaner to first clear all flags. But this is not possible because some end_borrow instructions
// might be missing in dead-end blocks. This will be fixed with complete OSSA lifetimes.

if let phi = phis.first(where: { phi in true }), !phi.value.parentFunction.hasOwnership {
return
}
Expand Down