Skip to content

SIL: Introduce has_symbol instruction #62147

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 4 commits into from
Nov 18, 2022

Conversation

tshortli
Copy link
Contributor

@tshortli tshortli commented Nov 17, 2022

Create a dedicated SIL instruction for if #_hasSymbol conditions. This solves two issues with the previous implementation:

  • if #_hasSymbol() can now be successfully inlined across module boundaries.
  • SIL functions that are referenced by the #_hasSybmol directive can be marked alive during dead function elimination, ensuring that the correct IR is generated even when the functions are otherwise unused in the program.

Resolves rdar://102159307

@tshortli
Copy link
Contributor Author

@swift-ci please test

@tshortli tshortli marked this pull request as ready for review November 17, 2022 00:17
@tshortli
Copy link
Contributor Author

Fixing the Linux build failure with #62150.

Copy link
Contributor

@nkcsgexi nkcsgexi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Love it! Much cleaner than emitting call sites and function definitions separately👍.

@nkcsgexi
Copy link
Contributor

@swift-ci please test

@nkcsgexi nkcsgexi merged commit c5a7eff into swiftlang:main Nov 18, 2022
@tshortli tshortli deleted the has-symbol-sil-instruction branch November 23, 2022 19:00
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