Skip to content

[NoncopyableGenerics] Basic end-to-end testing (without stdlib). #69591

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 8 commits into from
Nov 3, 2023

Conversation

kavon
Copy link
Member

@kavon kavon commented Nov 1, 2023

Some bug fixes and refactoring to start testing NoncopyableGenerics end-to-end.

kavon added 7 commits October 28, 2023 23:57
resolves rdar://117594962
We were missing some of the "artificial" types in the
TypeBase::isNoncopyable implementation. Rather than add them to the
frontend, I just check for those special SIL-only types in
SILType::isMoveOnly.

resolves rdar://117282929
@kavon kavon force-pushed the noncopyable-generics-pt3 branch from 948654f to 6fe00b6 Compare November 2, 2023 02:02
With the growing popularity of using Features, I think it's important to
ensure our Features querying set is as fast as possible. In particular,
we sometimes may end up putting a feature check in a hot function, so
the `contains` overhead is important.

While I haven't done *any* measurements to verify this, I think a
`llvm::SmallSet<Feature, 2>` is slower than a FixedBitSet. For the
former, if the set grows more than the constant size, it switches over
to using a `std::set`. Setting the size to `numFeatures()` is not
particularly attractive or possible, because `SmallSet` is limited to a
size of 32 to be considered small, as it uses linear search over a
SmallVector to service a `contains` query.

Meanwhile, a FixedBitSet has a small constant factor overhead for
querying if the element is contained: two divisions by a
constant power-of-two, a bit shift, and a memory-read / compare. I think
that'll beat a SmallSet in all cases.
@kavon kavon marked this pull request as ready for review November 2, 2023 02:36
@kavon kavon requested review from jckarter and removed request for xedin, slavapestov and hborla November 2, 2023 02:37
@kavon
Copy link
Member Author

kavon commented Nov 2, 2023

@swift-ci please test

@kavon
Copy link
Member Author

kavon commented Nov 2, 2023

@swift-ci Please test compiler performance

1 similar comment
@kavon
Copy link
Member Author

kavon commented Nov 2, 2023

@swift-ci Please test compiler performance

@kavon
Copy link
Member Author

kavon commented Nov 3, 2023

@swift-ci please smoke test and merge

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