Skip to content

[OSSACompleteLifetime] Recurse into scoped addresses. #78180

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 2 commits into from
Dec 14, 2024

Conversation

nate-chandler
Copy link
Contributor

Previously, when determining and completing lifetimes of scoped addresses, computeTransitiveLiveness was used to determine the liveness used for completing the lifetime.

That approach had two problems:
(1) The function does not find scope-ending uses of load_borrows. The result was determining that the lifetime of the enclosing store_borrow ended before that of the load_borrow.
(2) The function did not complete lifetimes of values defined within the scoped address whose lifetimes the scoped address had to contain. This was an inconsistency between the handling of scoped addresses and that of values.

Here, both are addressed by implementing a TransitiveAddressWalker (as computeTransitiveLiveness's callee does) which not only visits existing end_borrows of load_borrows but completes them (and other inner guaranteed values or scoped addresses).

rdar://141246601

Previously, when determining and completing lifetimes of scoped
addresses, `computeTransitiveLiveness` was used to determine the
liveness used for completing the lifetime.

That approach had two problems:
(1) The function does not find scope-ending uses of `load_borrow`s.
    The result was determining that the lifetime of the enclosing
    `store_borrow` ended before that of the `load_borrow`.
(2) The function did not complete lifetimes of values defined within the
    scoped address whose lifetimes the scoped address had to contain.
    This was an inconsistency between the handling of scoped addresses
    and that of values.

Here, both are addressed by implementing a `TransitiveAddressWalker` (as
`computeTransitiveLiveness`'s callee does) which not only visits
existing `end_borrow`s of `load_borrows` but completes them (and other
inner guaranteed values or scoped addresses).

rdar://141246601
@nate-chandler
Copy link
Contributor Author

@swift-ci please test

@nate-chandler
Copy link
Contributor Author

@swift-ci please test source compatibility

@nate-chandler
Copy link
Contributor Author

@swift-ci please apple silicon benchmark

@nate-chandler nate-chandler changed the title [OSSACompleteLifetime] Recurse into scoped addrs. [OSSACompleteLifetime] Recurse into scoped addresses. Dec 13, 2024
@nate-chandler
Copy link
Contributor Author

Source compat failures match failures in baseline

========================================
Failures:
  FAIL: SwiftLint-Legacy, 4.2, 60f98e, Swift Package
  FAIL: SwiftLint-Legacy, 4.0, 60f98e, Swift Package

@nate-chandler nate-chandler marked this pull request as ready for review December 14, 2024 05:20
@nate-chandler nate-chandler removed the request for review from jckarter December 14, 2024 05:21
@nate-chandler nate-chandler merged commit 120cf43 into swiftlang:main Dec 14, 2024
7 of 8 checks passed
@nate-chandler nate-chandler deleted the rdar141246601 branch December 14, 2024 16:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants