-
Notifications
You must be signed in to change notification settings - Fork 10.5k
Extend SILCombiner code to handle existential self concrete type propagation using ProtocolConformanceAnalysis #18109
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
@atrick Could you review this one now? |
0151185
to
7abdfbc
Compare
@atrick @slavapestov Any possibility of getting this review done quicker? Thanks. |
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.
This look correct on its own, except for the couple comments above. I'm fine if this goes in and we can review the rest of the design elsewhere.
/// This routine replaces the old witness method inst with a new one. | ||
void SILCombiner::replaceWitnessMethodInst( | ||
FullApplySite Apply, WitnessMethodInst *WMI, SILBuilderContext &BuilderCtx, | ||
const CanType &ConcreteType, ProtocolConformanceRef &ConformanceRef) { |
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.
I think ProtocolConformanceRef
should be passed by value.
// Bail, if this existential has a sole conforming type. If there is a sole | ||
// confirming type, we defer the determination of concrete type until cast | ||
// instructions are added in SILCombiner. | ||
if (hasSoleConformingType) |
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.
It's strange that you would intentionally construct an invalid ConcreteExistentialInfo
, presumably to "fill it in" later. I'll have to review the related patches to understand why you need to do this.
…agation using ProtocolConformanceAnalysis
@atrick handled your concern, I think. Can you look at it again? Notably, I removed the InitExistential != null check in isValid(). This seems a redundant check given that we are checking everything else to be not null. Also, for using the same isValid() with SoleConformingType, we may not have an InitExistential. Please let me know more concerns soon. I will commit the other PR based on these changes. |
LGTM |
@swift-ci Please smoke test |
Extend SILCombiner code to handle existential self concrete type propagation using ProtocolConformanceAnalysis.
Prior PR: