Skip to content

Fix SIL serialization of witness tables and protocol witness thunks #10380

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

Conversation

swiftix
Copy link
Contributor

@swiftix swiftix commented Jun 19, 2017

Serialize witness tables only if it -sil-serialize-all or -sil-serialize-witness-tables options are provided, which should happen only when building the stdlib and overlays, or it is a compilation with explicitly enabled resilience support. Disable serialization of witness tables in all other cases.

Disabling the serialization of witness tables also avoids serialization of protocol witness thunks, whose serialization in 3rd party code sometimes resulted in performance degradation, because resilience checking rules used by many parts of the compiler would prohibit certain optimizations like inlining or specialization, if the caller was serialized and the callee would not be serialized.

This should fix rdar://32718853 and address rdar://32743391

@swiftix
Copy link
Contributor Author

swiftix commented Jun 19, 2017

@swift-ci please smoke test

@swiftix
Copy link
Contributor Author

swiftix commented Jun 19, 2017

@slavapestov Could you have a look?

@slavapestov
Copy link
Contributor

LGTM!

Can you file a bug to evaluate the longer-term fix of only serializing unoptimized SIL?

@swiftix
Copy link
Contributor Author

swiftix commented Jun 19, 2017

@slavapestov Sure, I filed rdar://problem/32857153 for this

@swiftix
Copy link
Contributor Author

swiftix commented Jun 19, 2017

@swift-ci please smoke benchmark

@swift-ci
Copy link
Contributor

Build comment file:

Build failed before running benchmark.


swiftix added 3 commits June 19, 2017 19:49
…alization of SIL witness tables

This option is supposed to be used only for compiling overlays. User code should never be compiled with this option.
Serialize witness tables only if it -sil-serialize-all or -sil-serialize-witness-tables options are provided, which should happen only when building the stdlib and overlays, or it is a compilation with explicitly enabled resilience support. Disable serialization of witness tables in all other cases.

Disabling the serialization of witness tables also avoids serialization of protocol witness thunks, whose serialization in 3rd party code sometimes resulted in performance degradation, because resilience checking rules used by many parts of the compiler would prohibit certain optimizations like inlining or specialization, if the caller was serialized and the callee would not be serialized.

This should fix rdar://32718853   and address rdar://32743391
@swiftix swiftix force-pushed the witness-thunks-serialization-fixes-2 branch from d3456ea to 27d1edf Compare June 20, 2017 03:37
@swiftix
Copy link
Contributor Author

swiftix commented Jun 20, 2017

@swift-ci please test

1 similar comment
@swiftix
Copy link
Contributor Author

swiftix commented Jun 20, 2017

@swift-ci please test

@swiftix swiftix merged commit 0a55ddd into swiftlang:master Jun 20, 2017
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.

3 participants