Skip to content

[MoveOnlyAddressChecker] Fix enum representation. #72469

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 16 commits into from
Mar 22, 2024

Conversation

nate-chandler
Copy link
Contributor

@nate-chandler nate-chandler commented Mar 20, 2024

Based on #72463 .

Change FieldSensitive's enum representation to allow distinguishing among the elements with associated value. Consider unchecked_take_enum_data_addr to consume all other fields than that taken.

rdar://125113258

The function is long and will get longer.
The name `livenessUses` doesn't readily communicate the fact that those
uses are all non-consuming.
Previously, whenever an instruction was recorded as a final consume, a
new entry was added to finalBlockConsumes.  Here, this is changed to add
the new bits being consumed by the instruction to the preexisting
SmallBitVector, if there is one.
An instruction can consume multiple (discontiguous) fields.  Use a
SmallBitVector to track the fields consumed by an instruction rather
than a TypeTreeLeafRange.

rdar://125103951
The implementation of isUsableFromInline asserts that the function not
be public, so check that it's not before calling it.
@nate-chandler nate-chandler requested a review from jckarter March 20, 2024 21:54
Treat a take of a copyable value as a take.
@nate-chandler nate-chandler force-pushed the rdar125113258 branch 2 times, most recently from daa953c to ec2d90f Compare March 21, 2024 01:21
Change FieldSensitive's enum representation to allow distinguishing
among the elements with associated value.  Consider
`unchecked_take_enum_data_addr` to consume all other fields than that
taken.

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

@swift-ci please test

@nate-chandler
Copy link
Contributor Author

@swift-ci please test source compatibility

@nate-chandler
Copy link
Contributor Author

@swift-ci please apple silicon benchmark

@nate-chandler nate-chandler marked this pull request as ready for review March 22, 2024 00:17
@nate-chandler nate-chandler requested a review from kavon as a code owner March 22, 2024 00:17
@nate-chandler nate-chandler merged commit 4f6ed73 into swiftlang:main Mar 22, 2024
@nate-chandler nate-chandler deleted the rdar125113258 branch March 22, 2024 00:18
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