Skip to content

[OSLogOptimization] emitCodeForSymbolicValue should not attempt generating code for closures created by callers of os_log #30893

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

Conversation

ravikandhadai
Copy link
Contributor

Make emitCodeForSymbolicValue generate code for closures iff the closure is not created by the caller function where the code is generated. Otherwise, when the closure is created
by the caller, just reuse it after copying and extending its lifetime.

Before this change new closures were created as long as all captures of the closures were symbolic constants. This patch updates it so that even if all captures are symbolic constants no code is generated for closures that are already available in the caller. This avoids doing
needless work and also fixes the following bug, which arises because the emitCodeForSymbolicValue does not handle all possible constants (particularly, metatype constants) that are tracked by the constant evaluator .

rdar://problem/61465764

code for closures iff the closure is not created by the caller function
where the code is generated. Otherwise, when the closure is created
by the caller, just reuse it after copying and extending its lifetime.

Before this change new closures were created as long as all captures
of the closures were symbolic constants. This patch updates it so that
even if all captures are symbolic constants no code is generated for
closures that are already available in the caller. This avoids doing
needless work and also fixes the following bug.

<rdar://problem/61465764>
@ravikandhadai
Copy link
Contributor Author

@swift-ci Please test and merge

@swift-ci swift-ci merged commit 7068536 into swiftlang:master Apr 8, 2020
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