-
Notifications
You must be signed in to change notification settings - Fork 10.5k
[metadata prespecialization] Cross-module: structs and enums. #32354
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
[metadata prespecialization] Cross-module: structs and enums. #32354
Conversation
@swift-ci please test |
Build failed |
738f682
to
8fa0926
Compare
@swift-ci please test |
@swift-ci please benchmark |
Build failed |
Build failed |
Performance: -O
Code size: -OPerformance: -Osize
Code size: -OsizePerformance: -Onone
Code size: -swiftlibsHow to read the dataThe tables contain differences in performance which are larger than 8% and differences in code size which are larger than 1%.If you see any unexpected regressions, you should consider fixing the Noise: Sometimes the performance results (not code size!) contain false Hardware Overview
|
@swift-ci please clean test os x platform |
8fa0926
to
9606f82
Compare
@swift-ci please test |
Build failed |
Build failed |
@swift-ci please clean test os x platform |
@swift-ci please test |
Build failed |
@swift-ci please test os x platform |
Build failed |
@swift-ci please clean test os x platform |
9606f82
to
8a5d138
Compare
@swift-ci please test |
Build failed |
Build failed |
8a5d138
to
385e345
Compare
@swift-ci please test |
Build failed |
Build failed |
385e345
to
6d8bbd9
Compare
@swift-ci please test |
Build failed |
Build failed |
@swift-ci please clean test os x platform |
Build failed |
@swift-ci please clean test os x platform |
Build failed |
@swift-ci please clean test os x platform |
22e9c2d
to
52f39c9
Compare
@swift-ci please test |
Build failed |
Build failed |
f8ed98a
to
7e273e7
Compare
@swift-ci please test |
Build failed |
Build failed |
7e273e7
to
48834a5
Compare
@swift-ci please test |
Build failed |
Build failed |
When a generic type from a different module is not resilient within the current module and at least one of its arguments is from the current module, emit a non-canonical prespecialized record, and access that metadata via a call to swift_getCanonicalSpecializedMetadata, passing in the non-canonical record. rdar://problem/56996727 rdar://problem/56997022
48834a5
to
d4b82ba
Compare
@swift-ci please test |
Build failed |
Build failed |
@swift-ci please clean test macos |
@swift-ci please test windows |
@swift-ci please test source compatibility |
Initial support for cross-module metadata prespecialization.
Before, given a module
(1) canonical prespecialized metadata for
G<K>
was defined withinM
(2) it was referred to directly where it was used
and (3) it was returned from the metadata accessor for
G
In particular, note that the prespecialization for
G<K>
had to be done within the module which definedG
.Here, support is added for creating a prespecialization in a module different from that which defines the type. Given modules
(1) a non-canonical prespecialized metadata for
G<K>
is defined withinN
and (2) it is not referred to directly from where it is used but rather passed through the new runtime function
swift_getCanonicalSpecializedMetadata
The runtime call is necessary because it can't be statically guaranteed that metadata for the type described by the noncanonical prespecialization has not been created dynamically (or provided by a different noncanonical prespecialization). That might occur, for example, in the following way:
In this example,
instantiate
would be called beforenoncanonical specialized generic type metadata for G<K>
is passed toswift_getCanonicalSpecializedMetadata
. Consequently, a metadata record forG<K>
would be created dynamically and added to the runtime generic metadata cache. The invariant that there only be a single, canonical metadata record for the typeG<K>
must be preserved. As a result, the dynamically created metadata forG<K>
must be passed toprespecialize
. The new runtime call ensures that: the dynamically created metadata forG<K>
will be returned fromDependent on #32506