Skip to content

AST: Cache isNoncopyable() and isEscapable() bits inside TypeBase #82854

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

slavapestov
Copy link
Contributor

@slavapestov slavapestov commented Jul 7, 2025

The SIL optimizer makes frequent calls to these functions, so I think it makes sense to cache these because checkConformance() is quite expensive.

@slavapestov slavapestov requested review from hborla and xedin as code owners July 7, 2025 21:08
assert(!canType->hasTypeParameter());
assert(!canType->hasUnboundGenericType());
assert(!isa<SILBoxType>(canType));
assert(!isa<SILMoveOnlyWrappedType>(canType));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just double-checking: are the prior special cases for SILTokenType and SILPackType no longer needed?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

they are, and the build fails without them. bringing them back :)

@slavapestov slavapestov force-pushed the cache-invertible-conformances branch from 942a3b6 to 7bbe6f9 Compare July 7, 2025 21:45
@slavapestov slavapestov force-pushed the cache-invertible-conformances branch from 7bbe6f9 to b91ed32 Compare July 7, 2025 21:58
@slavapestov
Copy link
Contributor Author

@swift-ci Please smoke test

@slavapestov
Copy link
Contributor Author

@swift-ci Please test source compatibility

@slavapestov
Copy link
Contributor Author

@swift-ci Please test Windows

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