-
Notifications
You must be signed in to change notification settings - Fork 10.3k
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
[SIL] Add [serialized_for_package] to control package-wide resilience domain in Package-CMO. #73566
Conversation
We should block inlining a Otherwise, you end up with the code originating from a We achieve the analogous thing for serialized and not-serialized functions here: |
package-wide resilience domain if Package CMO is enabled. The purpose of the attribute includes: - Indicates that certain types such as loadable types are allowed in serialized functions in resiliently built module if the optimization is enabled, which are otherwise disallowed. - Used during SIL deserialization to determine whether such functions are allowed. - Used to determine if a callee can be inlined into a caller that's serialized without package-cmo, e.g. with an explicit annotation like @inlinable, where the callee was serialized due to package-cmo. Resolves rdar://127870822
@swift-ci smoke test |
I think the bits should be mutually exclusive no? So both should not be set at once. [serialized] is the stonger condition so if its set, it implies the same invariants as [serialized_for_package] but adds more. |
@swift-ci smoke test |
-Fix SILDeclRef getLinkageLimit() for GlobalAccessor to return Limit::None if bypassResilienceInPackage is enabled.
@swift-ci smoke test |
@swift-ci smoke test |
@@ -162,6 +162,11 @@ enum IsSerialized_t : unsigned char { | |||
IsSerialized | |||
}; | |||
|
|||
enum IsSerializedForPackage_t : unsigned char { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree with Slava. You should combine both enums, e.g.
enum IsSerialized_t : unsigned char {
IsNotSerialized,
IsSerialized,
IsSerializedForPackage
};
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we can serialization_t tri-state enum as a follow up PR that also addresses inlinability
we can address ... |
This PR adds a new attribute [serialized_for_package] to allow
more fine-control over package-wide resilience domain if
Package CMO is enabled.
The purpose of the attribute includes:
allowed in serialized functions in resiliently built module
if the optimization is enabled, which are otherwise disallowed.
functions are allowed.
that's serialized without package-cmo, e.g. with an explicit
annotation like @inlinable, where the callee was serialized
due to package-cmo.
Resolves rdar://127870822&127321129&127308331