Skip to content

[NFC] AST: Optimize GenericSignatureImpl::getInnermostGenericParams #31838

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
Jun 4, 2020

Conversation

AnthonyLatsis
Copy link
Collaborator

@AnthonyLatsis AnthonyLatsis commented May 16, 2020

Adding a fast path that enables us to simplify the successive loop.

Judging by the abundance of BoundGenericType::getGenericArgs usage, we are going to have to call GenericSignatureImpl::getInnermostGenericParams much more often once we start storing substitution maps in bound generic type nodes, so this is ensuring the latter is as fast as possible without caching.


For #31895

@AnthonyLatsis AnthonyLatsis requested a review from CodaFi May 16, 2020 05:27
@AnthonyLatsis
Copy link
Collaborator Author

@swift-ci please smoke test

@AnthonyLatsis
Copy link
Collaborator Author

@CodaFi ping

@CodaFi
Copy link
Contributor

CodaFi commented Jun 4, 2020

After sitting down and reasoning about this transformation on paper, I think we're good here. There may be some worrying code that slips through the many, many assertions we have in the signature formation code that maintains the depth ordering invariant that allows this code to function, but we'll worry about that bridge when we cross it.

@CodaFi CodaFi merged commit 9357c85 into swiftlang:master Jun 4, 2020
@AnthonyLatsis AnthonyLatsis deleted the o-getinnermostgps branch June 4, 2020 19:44
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.

None yet

2 participants