Skip to content

SILGen: Emit references to noncopyable global storage directly as a borrow. #73041

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

Conversation

jckarter
Copy link
Contributor

Later analyses are too conservative to remove a copy, but it should be fairly safe to elide the copy for noncopyable globals, since accesses are tightly scoped and dynamically checked, so consumes aren't possible, and borrows and inout accesses of mutable globals are dynamically guarded and not subject to exclusivity checks. rdar://114329759

@jckarter jckarter requested a review from kavon as a code owner April 15, 2024 22:51
@jckarter
Copy link
Contributor Author

@swift-ci Please test

…orrow.

Later analyses are too conservative to remove a copy, but it should be fairly safe to
elide the copy for noncopyable globals, since accesses are tightly scoped and dynamically checked,
so consumes aren't possible, and borrows and inout accesses of mutable globals are dynamically
guarded and not subject to exclusivity checks. rdar://114329759
@jckarter jckarter force-pushed the silgen-borrow-noncopyable-global-lets branch from 563753a to 4077c75 Compare April 15, 2024 23:12
@jckarter
Copy link
Contributor Author

@swift-ci Please test

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.

1 participant