Skip to content

[move-only] When adding implicit liveness uses for class field/global accesses, do not use the terminator, use the end access. #67088

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

gottesmm
Copy link
Contributor

@gottesmm gottesmm commented Jul 3, 2023

Previously, when doing this I could just use the terminator both in cases of
inout and for class field/global accesses... but after some recent changes to
field sensitive pruned liveness, this seems to no longer work. So just do the
right thing and use the field access.

The specific bug was that we would introduce a destroy_addr along one of the
paths where the value wasn't defined resulting in a dominance error.

I added a SIL test that shows this fixes the issue, a swift test, and also an
Interpreter test that validates the correctness.

rdar://111659649

@gottesmm gottesmm requested a review from jckarter July 3, 2023 00:53
@gottesmm
Copy link
Contributor Author

gottesmm commented Jul 3, 2023

@swift-ci test

2 similar comments
@gottesmm
Copy link
Contributor Author

gottesmm commented Jul 3, 2023

@swift-ci test

@gottesmm
Copy link
Contributor Author

gottesmm commented Jul 3, 2023

@swift-ci test

@gottesmm
Copy link
Contributor Author

gottesmm commented Jul 3, 2023

I found the problem. We were not properly converting an assignable_but_not_consumable to initable_but_not_consumable in DefiniteInitialization.

gottesmm added 4 commits July 3, 2023 15:49
…r to bisect on variables that we are checking.

These are only on in NDEBUG mode. It just makes it easier to quickly triage
which variable is causing a checking problem.
… accesses, do not use the terminator, use the end access.

Previously, when doing this I could just use the terminator both in cases of
inout and for class field/global accesses... but after some recent changes to
field sensitive pruned liveness, this seems to no longer work. So just do the
right thing and use the field access.

The specific bug was that we would introduce a destroy_addr along one of the
paths where the value wasn't defined resulting in a dominance error.

I added a SIL test that shows this fixes the issue, a swift test, and also an
Interpreter test that validates the correctness.

rdar://111659649
…ble_but_not_consumable -> initable_but_not_consumable.

I fixed this for assign but missed a place where we needed to do the same thing for copy_addr.

rdar://111709236
Both of the previous fixes in this PR were found via this test.
@gottesmm gottesmm force-pushed the pr-f9b416b5281022981483e4d42a150a0ff0aec2e3 branch from 29ca777 to 268cd76 Compare July 3, 2023 22:55
@gottesmm
Copy link
Contributor Author

gottesmm commented Jul 3, 2023

@swift-ci test

@gottesmm
Copy link
Contributor Author

gottesmm commented Jul 3, 2023

Mishal just validated for me on the bot, that the test passes now.

@gottesmm gottesmm merged commit 07f9384 into swiftlang:main Jul 4, 2023
@gottesmm gottesmm deleted the pr-f9b416b5281022981483e4d42a150a0ff0aec2e3 branch July 4, 2023 04:40
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