Skip to content

Specify the unchecked_ownership_conversion instruction #34742

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 17, 2020

Conversation

atrick
Copy link
Contributor

@atrick atrick commented Nov 14, 2020

And a few minor commits related to verification of this instruction.

All SIL instructions need their semantics specified in SIL.rst and their
constraints specified in SILVerifier.
That prevents the SILVerifier from printing the context, making it
hard to quickly produce test cases from logs.

Instead, just return the failure status to the SILVerifier so it can
do its diagnostic thing.

An assert or llvm_unreachable would also be fine in addition to the
normal SILVerifier diagnostics, but I don't think that's needed here.
@atrick atrick requested a review from gottesmm November 14, 2020 00:55
@atrick
Copy link
Contributor Author

atrick commented Nov 14, 2020

@swift-ci smoke test

I can't reason about whether this is correct to do, because SIL both
uses the side-effects semantics to model arbitrary implicit
dependencies and simultaneously considers them to be memory
writes. What's more, the SIL instruction definitions almost *never*
specify the actual constraints that we're attempting to approximate with
the model.

Be that as it may, we can't verify SIL if we "conservatively" consider
instructions that don't write to memory to be writes. So I'll attempt
to fix the undocumented model and find out what breaks.

Fixes rdar://70737095 Unknown instruction: unchecked_ownership_conversion
@atrick atrick force-pushed the fix-unchecked-ownership branch from 6a9e6da to f529072 Compare November 16, 2020 20:01
@atrick
Copy link
Contributor Author

atrick commented Nov 16, 2020

@swift-ci test

@atrick
Copy link
Contributor Author

atrick commented Nov 16, 2020

@swift-ci test source compatibility

@atrick atrick merged commit c4abccb into swiftlang:main Nov 17, 2020
@atrick atrick deleted the fix-unchecked-ownership branch October 19, 2022 00:30
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.

1 participant