-
Notifications
You must be signed in to change notification settings - Fork 10.5k
Fix SILCombine of existential applies #78412
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
Conversation
@swift-ci test |
df72b54
to
fa445a6
Compare
I don't think this is a good idea. Inserting a copy+destroy might be worse than not propagating the concrete type of existential. The optimizer should never insert copies which are not there in the first place. I suggest to just not do the optimization in such a case. |
183582e
to
e4c263c
Compare
This code was previously creating illegal unchecked_ref_cast with same source and destination.
d1f964e
to
13027ae
Compare
@swift-ci test |
This PR fixes some source compatibility failures: rdar://142298318 |
Don't use previously found owned concrete values in ossa. They will consumed by forwarding operations like init_existential_ref. Instead create an unconditional cast of the opened existential to concrete type and use that to create a concrete apply.
13027ae
to
ed0483b
Compare
@swift-ci test |
@swift-ci test source compatibility |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
@swift-ci smoke test Linux platform |
@swift-ci smoke test Linux platform |
#78354 enabled silcombine to propagate concrete type of existentials in ossa. However when the concrete value is
owned
it is consumed by theinit_existential_ref
forwarding operation. In this case we create an unchecked cast of the opened existential to the concrete type and use that in the apply.