Skip to content

Conversation

@nate-chandler
Copy link
Contributor

Currently, CopyPropagation only† canonicalizes defs that are "canonical", that is, the root of the copy_value tree. When that canonical def is lexical, however, the canonicalization respects deinit barriers. But copies of lexical values are not themselves lexical, so their lifetimes can be shortened without respect to deinit barriers.

Here, immediate copies of lexical values are canonicalized before the lexical values themselves are.

rdar://107197935

Currently, CopyPropagation only canonicalizes defs that are "canonical",
that is, the root of the copy_value tree.  When that canonical
def is lexical, however, the canonicalization respects deinit barriers.
But copies of lexical values are not themselves lexical, so their
lifetimes can be shortened without respect to deinit barriers.

Here, immediate copies of lexical values are canonicalized before the
lexical values themselves are.

rdar://107197935
@nate-chandler nate-chandler force-pushed the copy-propagation/canonicalize-lexical-copies branch from 10a02d8 to 4f0d1da Compare March 27, 2023 14:11
@nate-chandler
Copy link
Contributor Author

@swift-ci please test

@nate-chandler
Copy link
Contributor Author

@swift-ci please benchmark

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.

Great!

@nate-chandler nate-chandler merged commit 1254a71 into swiftlang:main Mar 27, 2023
@nate-chandler nate-chandler deleted the copy-propagation/canonicalize-lexical-copies branch March 27, 2023 20:56
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