Skip to content

[Archetype builder] Suppress redundant constraints more effectively. #7228

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 1 commit into from
Feb 3, 2017

Conversation

DougGregor
Copy link
Member

Fix a couple of places where we were not managing to consider
redundant constraints as 'redundant', so the canonicalized generic
signatures were not in fact minimal. Address this in several places:

  • When a type is made concrete, any superclass requirements on it are
    redundant
  • When a type is made concrete, any same-type relationships among its
    nested types are redundant
  • Only emit potential-archetype-to-concrete constraints in the
    resulting signature for the component anchors; not for every type.

The first two bullets were existing problems that are now fixed; the
last is something I appear to have introduced with last week's
refactoring of canonicalized same-type constraints.

The recent work to make the canonicalization deterministic exacerbated
the issue considerably, leading to huge blow-up in the size of
canonical generic signatures that cost ~100k in standard library
size. This change recovers that 100k.

Fix a couple of places where we were not managing to consider
redundant constraints as 'redundant', so the canonicalized generic
signatures were not in fact minimal. Address this in several places:

* When a type is made concrete, any superclass requirements on it are
  redundant
* When a type is made concrete, any same-type relationships among its
  nested types are redundant
* Only emit potential-archetype-to-concrete constraints in the
  resulting signature for the component anchors; not for every type.

The first two bullets were existing problems that are now fixed; the
last is something I appear to have introduced with last week's
refactoring of canonicalized same-type constraints.

The recent work to make the canonicalization deterministic exacerbated
the issue considerably, leading to huge blow-up in the size of
canonical generic signatures that cost ~100k in standard library
size. This change recovers that 100k.
@DougGregor
Copy link
Member Author

@swift-ci please smoke test and merge

@swift-ci swift-ci merged commit 0549822 into swiftlang:master Feb 3, 2017
@DougGregor DougGregor deleted the more-constraint-minimization branch February 3, 2017 18:48
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.

2 participants