Skip to content

[SILOpt][OSLog] Skip constant folding StaticString in the OSLogOptimization pass #79941

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 1 commit into from
Mar 17, 2025

Conversation

ravikandhadai
Copy link
Contributor

The OSLogOptimization pass constant evaluates and folds SIL instructions that are inlined from the construction of the string interpolations passed to the log calls, which enables replacing the dynamic format string construction with a static format string. In addition to folding constant strings, it also folds constant integers and arrays whose elements are constants. This change makes it skip folding static strings, since they are already efficiently represented.

This patch unblocks #79707

cc @DougGregor

OSLogOptimization pass

The OSLogOptimization pass constant evaluates and folds SIL instructions
that are inlined from the construction of the string interpolations passed
to the log calls, which enables replacing the dynamic format string construction
with a static format string. In addition to folding constant strings, it also folds
constant integers and arrays whose elements are constants. This change makes it
skip folding static strings, since they are already efficiently represented.

rdar://146028438
@ravikandhadai
Copy link
Contributor Author

@swift-ci test

@DougGregor
Copy link
Member

@swift-ci test macOS

@DougGregor
Copy link
Member

@swift-ci please test Windows

@DougGregor
Copy link
Member

Windows tests passed in #79707

@DougGregor
Copy link
Member

@swift-ci please test Windows

@DougGregor DougGregor merged commit 1c78d0c into swiftlang:main Mar 17, 2025
5 checks passed
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