Aggressive CMO can force the serialization of the bodies of @export(interface) functions#88446
Open
DougGregor wants to merge 3 commits intoswiftlang:mainfrom
Open
Aggressive CMO can force the serialization of the bodies of @export(interface) functions#88446DougGregor wants to merge 3 commits intoswiftlang:mainfrom
@export(interface) functions#88446DougGregor wants to merge 3 commits intoswiftlang:mainfrom
Conversation
… & SIL For a given function, we might end up emitting it's definition as object code, serialized SIL, or both. The @export, @inlinable, and @inline(always) attributes provide control of this behavior at the declaration level. Centralize the query function that will look for each of these attributes and map down to a specific "code generation model", whose 3 options follow the naming from SE-0497: interface, inlinable, and implementation. Use this one computation to back the queries for "always emit into client", "never emit into client", and "inlinable" so we can't get inconsistent results from places that are doing one-off checks for these attributes.
Member
Author
|
@swift-ci please smoke test |
…ctions The `@export(interface)` and `@export(implementation)` attributes SE-0497 are queried directly on AST nodes in several places within the SIL pipeline. However, they don't persist when SIL functions are serialized, meaning that clients of the original module might make different assumptions about the availability of a given function's definition. Represent these attributes in a SIL function (as an optional CodeGenerationModel), (de-)serialize them into the module, and add a textual representation as SIL function attributes `[export_interface]` and `[export_implementation]`.
Member
Author
|
@swift-ci please test |
@export(interface) functions
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
@export(interface)as introduced by SE-0497, causing those function definitions to be serialized if they're needed by other serialized functions. Make CMO honor@export(interface).@export(interface),@export(implementation),@inlineable, or the default, and extends the SIL function definition to include these options as well. This ensures that (1) we have more consistent computation of this information, and (2) it is always available to CMO, even after deserialization.