-
Notifications
You must be signed in to change notification settings - Fork 10.5k
[Constraint solver] Generalize disjunction favoring #23088
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
DougGregor
merged 7 commits into
swiftlang:master
from
DougGregor:solver-disjunction-favoring
Mar 5, 2019
Merged
[Constraint solver] Generalize disjunction favoring #23088
DougGregor
merged 7 commits into
swiftlang:master
from
DougGregor:solver-disjunction-favoring
Mar 5, 2019
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…oadDisjunction Use the real one instead.
The call-favoring code was creating a two-level disjunction, when would then immediately get flattened into a single level. Instead, create a single-level disjunction directly.
The disjunction partitioning logic was only used for the experimental designated-types feature, but is generally useful. Unify the code paths so we always do the partitioning, with only the designated-types part being enabled/disabled by the flag.
When favoring particular constraints in a disjunction, don't remove the old disjunction and create a new one---it's just churn in the constraint system. Instead, favor the constraints that need it. This technically flips the SR-139 test case from "too complex" to being fast enough, but it's still fairly slow.
…pe(). The overload-favoring code had a couple of different ways in which it tried to figure out the parameter lists of a given declaration. Have those all depend on ConstraintSystem::getEffectiveOverloadType(), which deals with the various member/non-member cases uniformly.
@swift-ci please smoke test |
@swift-ci please test source compatibility |
@swift-ci please smoke test performance |
@swift-ci please smoke test compiler performance |
… solving Allow constraints to be favored during solving, and unwound after exiting that particular solver scope. We're not using this yet.
…ation. Use tryOptimizeGenericDisjunction() as part of simplifying apply constraints.
57f2641
to
20bb077
Compare
@swift-ci please smoke test |
1 similar comment
@swift-ci please smoke test |
@swift-ci please test source compatibility |
1 similar comment
@swift-ci please test source compatibility |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Clean up the disjunction favoring code to enable favoring of disjunction terms during constraint solving, unifying some of the code around existing utility functions in the constraint solver (
getUnboundBindOverload()
,getEffectiveOverloadType()
) rather than hand-rolled versions.