Skip to content

Fixes for witness method devirtualization #5306

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 2 commits into from
Oct 17, 2016

Conversation

swiftix
Copy link
Contributor

@swiftix swiftix commented Oct 15, 2016

Fix a couple of issues in sil-combine and devirtualizer.

Resolves SR-2623.

@swiftix
Copy link
Contributor Author

swiftix commented Oct 15, 2016

@swift-ci Please smoke test

@swiftix
Copy link
Contributor Author

swiftix commented Oct 15, 2016

@eeckstein Erik, do you mind taking a look?

@eeckstein
Copy link
Contributor

LGTM! Thanks for fixing this

Just a minor suggestion: maybe it makes sense to factor out the code which checks for legal upcasts in to a utility function. If you like you can do this in a separate commit

@swiftix swiftix force-pushed the fixes-for-witness-method-devirt branch from 8faa7fa to 69cf720 Compare October 15, 2016 21:37
@swiftix
Copy link
Contributor Author

swiftix commented Oct 15, 2016

@eeckstein Do you mean something like what I just pushed?

@eeckstein
Copy link
Contributor

Yes, and also use this function in SILVerifier::checkUpcast. (Of course we would have only a single failure-message then, but I think this is OK).

Before generating an upcast instruction, make sure that the required type conversion is valid.

Fixes rdar://28601761
…te types of existentials

- Do not try to make a lookup type of a witness_method more concrete if it not an opened existential.
- Replace witness_method instruction by a new one with a more concrete type only in the specific apply instruction instead of doing it everywhere. This allows for more optimization opportunities if the same witness_method is used by multiple apply instructions.
@swiftix swiftix force-pushed the fixes-for-witness-method-devirt branch from 69cf720 to 1e6edcb Compare October 17, 2016 17:42
@swiftix
Copy link
Contributor Author

swiftix commented Oct 17, 2016

@swift-ci Please smoke test

@swiftix swiftix merged commit 027d8a7 into swiftlang:master Oct 17, 2016
swiftix added a commit to swiftix/swift that referenced this pull request Oct 17, 2016
…od-devirt

Fixes for witness method devirtualization
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.

4 participants