Repository navigation
Conversation
Collaborator
|
r? @cuviper rustbot has assigned @cuviper. Use Why was this reviewer chosen?The reviewer was selected based on:
|
Contributor
Author
|
@rustbot label llvm-main |
Contributor
Author
|
r? @nikic |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Contributor
|
@MaskRay I'm curious how LibraryOptions is supposed to be adopted incrementally. Ideally, we would be parsing the options per-context -- but while not all options are per-context, the ones which are not would get parsed globally multiple times. That's not (thread) safe, right? So does that mean that until the global options are entirely gone, we should basically keep using a global LibraryOptions, rather than a per-context (and thus per-thread) one? (That is, do what this PR does?) |
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
LLVM has been refactoring how it stores its internal (-mllvm) options recently, with the goal of getting rid of the global cl::opt objects.
After https://github.com/llvm/llvm-project/pull/233044 LTO passes no longer uses the global options, which would cause codegen-llvm/pgo-counter-bias.rs to fail since it relies on the -runtime-counter-relocation option to get passed to LTO.
IIUC, ideally we should change LLVMRustSetLLVMOptions to take an LLVMContext as argument and parse the options into that. However, I think by the time we currently call it, no such context has been created yet.
Instead, this PR maintains the status quo by parsing the options into a global object, which is then assigned to new LLVMContexts as they are created.