-
Notifications
You must be signed in to change notification settings - Fork 10.5k
[Constraint graph] Gathering "all mentions" constraints means all mentions #26691
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
[Constraint graph] Gathering "all mentions" constraints means all mentions #26691
Conversation
We only care about gathering a one-way constraint if (1) the left-hand side is in the set of type variables we care about now, and (2) the type variable we started from is in the right-hand side.
…tions. When requesting all constraints that mention the given type variable, use a depth-first search to ensure that we find all mentions, rather than some subset of them. Fixes rdar://problem/54322807.
@swift-ci please smoke test |
@swift-ci please test source compatibility |
@swift-ci please test compiler performance |
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! Only possible side-effect I see is related to isInterestingTypeVar
it might be worse adding test-case from #19852 to use suite to make sure that performance doesn't regress.
@swift-ci please smoke test Linux platform |
This conflicts heavily with #26779, which goes back to the way Swift 5.1 found "all mentions" when gathering constraints. Looking at the total number of constraint scopes seen as part of processing the source compatibility suite:
I suspect that we can come up with tighter heuristics that gather everything that the solver needs to proceed after binding a type variable, but without grabbing too many "extra" constraints that shouldn't be reprocessed. Until then---or we make up the difference somewhere else---this pull request will remain open but unmerged. |
Also, landing this means we can revert #26749 |
Obsoleted by #30886 ! |
When requesting all constraints that mention the given type variable,
use a depth-first search to ensure that we find all mentions, rather
than some subset of them. Fixes rdar://problem/54322807.