-
Notifications
You must be signed in to change notification settings - Fork 342
[GlobalDCE] Add !llvm.used.conditional support for conditionally used global variables #3396
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
@swift-ci please test |
@swift-ci please test macOS platform |
1 similar comment
@swift-ci please test macOS platform |
Looks like there's a failure on macOS which may be relevant:
|
ac9ede0
to
6cdc7b4
Compare
Addressed (on the Swift side), it was the IR Verifier not liking the slightly-different version of llvm.used.conditional that is used in this test :) The next run should be clean. |
@swift-ci please test |
6cdc7b4
to
e30d26c
Compare
@swift-ci please test |
e30d26c
to
97c2cc4
Compare
@swift-ci please test |
@swift-ci please test macOS platform |
… global variables As part of the optimization work to emit dead-strippable symbols for Swift and enable GlobalDCE to remove those symbols when possible, we need to mark some Swift symbols as conditionally used based on a set of other symbols. Background info can be found here: https://bugs.swift.org/browse/SR-14509. This diff adds a module-level name metadata !llvm.used.conditional, which contains a list of metadata triplets, that describes the conditions under which we allow removal of globals even if they are mentioned in @llvm.used. See the included LangRef changes to details. The implementation is a strict addition, it does not change any semantics and does not affect IR or passes in any way, unless !llvm.used.conditional is present in the input IR.
97c2cc4
to
887b8da
Compare
@swift-ci please test |
This PR lands a preview version of !llvm.used.conditional that is not yet merged in upstream LLVM and is being reviewed at https://reviews.llvm.org/D104496, but it's important to unblock progress in adopting these changes in Swift. Once upstream LLVM gets !llvm.used.metadata (or a differently-named or differently-implemented) support, which downstream change will be reverted.
Commit message: