Skip to content

[AddressLowering] End borrow scopes for extracts/destructures at enclosing guaranteed boundary. #67384

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

Conversation

nate-chandler
Copy link
Contributor

@nate-chandler nate-chandler commented Jul 19, 2023

The load_borrows created when lowering destructure and extract instructions may have users that have escaping operand ownership. Consequently, we can't rely on findInnerTransitiveGuaranteedUses as used by emitEndBorrows.

In fact, this is generally true, so the emitEndBorrows function needs to be eliminated. This is the first step in that process.

@nate-chandler nate-chandler force-pushed the opaque-values/20230718/1/emit_end_borrows/destructure_and_extract branch from 4e94109 to 0fccca9 Compare July 19, 2023 01:30
@nate-chandler
Copy link
Contributor Author

@swift-ci please test

@nate-chandler nate-chandler force-pushed the opaque-values/20230718/1/emit_end_borrows/destructure_and_extract branch from 0fccca9 to a7f99f7 Compare July 19, 2023 14:15
@nate-chandler
Copy link
Contributor Author

@swift-ci please test

@nate-chandler nate-chandler force-pushed the opaque-values/20230718/1/emit_end_borrows/destructure_and_extract branch from a7f99f7 to 7ca5f6e Compare July 19, 2023 20:17
@meg-gupta
Copy link
Contributor

LGTM

A destructure may have users that have escaping operand ownership.
Consequently, we can't rely on findInnerTransitiveGuaranteedUses as used
by emitEndBorrows.
An extract may have users that have escaping operand ownership.
Consequently, we can't rely on findInnerTransitiveGuaranteedUses as used
by emitEndBorrows.
@nate-chandler nate-chandler force-pushed the opaque-values/20230718/1/emit_end_borrows/destructure_and_extract branch from 7ca5f6e to 4c5ce62 Compare July 19, 2023 23:07
@nate-chandler
Copy link
Contributor Author

@swift-ci please test

@nate-chandler nate-chandler merged commit b1c5631 into swiftlang:main Jul 20, 2023
@nate-chandler nate-chandler deleted the opaque-values/20230718/1/emit_end_borrows/destructure_and_extract branch July 20, 2023 13:57
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.

3 participants