Skip to content

[SILInliner] Only guaranteed args get lexical lifetimes. #39712

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 Oct 13, 2021

Previously, when inlining, both owned and guaranteed arguments were wrapped in lexical lifetimes before using them within inlined callees. That is redundant, however, because SILGen add lexical lifetimes for owned arguments within functions. Here, the redundancy is removed by only adding lexical lifetimes for guaranteed arguments that are passed to inlined callees.

Previously, when inlining, both owned and guaranteed arguments were
wrapped in lexical lifetimes before using them to within inlined
callees.  That is redundant, however, because SILGen add lexical
lifetimes for owned arguments within functions.  Here, the redundancy is
removed by only adding lexical lifetimes for guaranteed arguments that
are passed to inlined callees.
@nate-chandler
Copy link
Contributor Author

@swift-ci please test

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.

👍

@nate-chandler nate-chandler merged commit 4424696 into swiftlang:main Oct 13, 2021
@nate-chandler nate-chandler deleted the lexical_lifetimes/only-give-guaranteed-args-lexical-lifetimes-during-inlining branch October 13, 2021 15:50
nate-chandler added a commit to nate-chandler/swift that referenced this pull request Oct 15, 2021
Previously, after swiftlang#39712, lexical
lifetimes were added for arguments whose parameter convention was
guaranteed.  Those lexical borrow scopes were added regardless of the
ownership of the values which were passed as those arguments.  Here, the
lifetimes are only added for argument values which have ownership.
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