Skip to content

Conversation

tshortli
Copy link
Contributor

@tshortli tshortli commented Oct 3, 2025

#67920 introduced a mandatory SIL optimization that eliminates switch statement dispatch for enum elements that are provably unavailable at runtime. This optimization helps eliminate unreachable code, but it's also load bearing because it removes references to enum element symbols that may not preset at link time. The optimization was checking the wrong condition to determine whether an enum element is unavailable at runtime and so the optimization wasn't working for code using custom availability domains.

Resolves rdar://161846311.

@tshortli tshortli requested a review from eeckstein as a code owner October 3, 2025 22:02
@tshortli
Copy link
Contributor Author

tshortli commented Oct 3, 2025

@swift-ci please smoke test

@azharudd
Copy link
Contributor

azharudd commented Oct 3, 2025

@swift-ci test

…le cases.

swiftlang#67920 introduced a mandatory SIL
optimization that eliminates switch statement dispatch for enum elements that
are provably unavailable at runtime. This optimization helps eliminate
unreachable code, but it's also load bearing because it removes references to
enum element symbols that may not preset at link time. The optimization was
checking the wrong condition to determine whether an enum element is
unavailable at runtime and so the optimization wasn't working for code using
custom availability domains.

Resolves rdar://161846311.
@tshortli tshortli force-pushed the switch-dispatch-mandatory-optimization-for-custom-availability branch from 769012d to 270ea8b Compare October 4, 2025 00:32
@tshortli
Copy link
Contributor Author

tshortli commented Oct 4, 2025

@swift-ci please smoke test

@tshortli tshortli merged commit 08eaf82 into swiftlang:main Oct 4, 2025
4 of 5 checks passed
@tshortli tshortli deleted the switch-dispatch-mandatory-optimization-for-custom-availability branch October 4, 2025 14:25
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.

4 participants