Skip to content

SILOptimizer: Make some analysis caches lazy #68233

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 3 commits into from
Aug 31, 2023

Conversation

tshortli
Copy link
Contributor

@tshortli tshortli commented Aug 31, 2023

When serializing modules with -experimental-skip-all-function-bodies, the ClassHierarchyAnalysis and ProtocolConformanceAnalysis analyses were eagerly populating caches that would go unused since there is no optimization to do when there are no SIL function bodies. With -experimental-lazy-typecheck, this work would also trigger unnecessary typechecking requests. NFC.

@tshortli
Copy link
Contributor Author

@swift-ci please test

@tshortli tshortli changed the title SILOptimizer: Make ClassHierarchyAnalysis and ProtocolConformanceAnalysis lazy SILOptimizer: Make some analysis caches lazy Aug 31, 2023
@slavapestov
Copy link
Contributor

Would it be a lot of work to refactor these to use requests?

When serializing modules with `-experimental-skip-all-function-bodies`, this
analysis was eagerly populating a cache that would go unused since there is no
optimization to do. With `-experimental-lazy-typecheck`, this work would also
trigger unnecessary typechecking requests. NFC.
When serializing modules with `-experimental-skip-all-function-bodies`, this
analysis was eagerly populating a cache that would go unused since there is no
optimization to do. With `-experimental-lazy-typecheck`, this work would also
trigger unnecessary typechecking requests. NFC.
@tshortli tshortli force-pushed the lazier-sil-optimizer-analysis branch from df8de5f to 255d5d4 Compare August 31, 2023 17:59
@tshortli
Copy link
Contributor Author

@swift-ci please smoke test

@tshortli
Copy link
Contributor Author

Would it be a lot of work to refactor these to use requests?

I'd like to prioritize working on what this is unblocking but I've left a note indicating that these could be made requests in the future.

@tshortli tshortli merged commit 5422f9a into swiftlang:main Aug 31, 2023
@tshortli tshortli deleted the lazier-sil-optimizer-analysis branch August 31, 2023 21:51
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