Skip to content

[SIL] Key consume checking off var_decl attr. #70054

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 4 commits into from
Nov 28, 2023

Conversation

nate-chandler
Copy link
Contributor

Previously, the lexical attribute on begin_borrow instructions was used to determine the roots of values for which consume checking should be performed. This doesn't work for values without lexical lifetimes which are consumed, e.g. stdlib CoW types. Here, the new var_decl attribute on begin_borrow is keyed off of instead. This flag encodes exactly that a value corresponds to a source-level VarDecl, which is the condition under which checking needs to run.

rdar://118059326

@nate-chandler nate-chandler requested a review from atrick November 28, 2023 02:33
@nate-chandler nate-chandler force-pushed the rdar118059326 branch 2 times, most recently from 2401c38 to 9919784 Compare November 28, 2023 15:13
Previously, the lexical attribute on begin_borrow instructions was used.
This doesn't work for values without lexical lifetimes which are
consumed, e.g. stdlib CoW types.  Here, the new var_decl attribute on
begin_borrow is keyed off of instead.  This flag encodes exactly that a
value corresponds to a source-level VarDecl, which is the condition
under which checking needs to run.

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

@swift-ci please test

@nate-chandler
Copy link
Contributor Author

@swift-ci please apple silicon benchmark

@nate-chandler
Copy link
Contributor Author

@swift-ci please test source compatibility

Copy link
Contributor

@atrick atrick left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome!

@nate-chandler nate-chandler marked this pull request as ready for review November 28, 2023 18:43
@nate-chandler nate-chandler merged commit 126022f into swiftlang:main Nov 28, 2023
@nate-chandler nate-chandler deleted the rdar118059326 branch November 28, 2023 19:54
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