[clang][deps] Avoid CompilerInvocation copies - #13201
Merged
Merged
Conversation
Author
|
Ping. |
benlangmuir
reviewed
Jun 17, 2026
Author
|
By propagating cow upwards, I realized most of my |
Author
|
Ping. |
benlangmuir
reviewed
Jun 23, 2026
benlangmuir
left a comment
There was a problem hiding this comment.
Mostly LGTM; couple of questions
| llvm::function_ref<bool(std::string &)> Callback) { | ||
| // Ensure exclusive ownership of every option group, so that visitPathsImpl() | ||
| // doesn't affect any other invocations. | ||
| // FIXME: Do this only if \c Callback does decide to modify any strings in an |
There was a problem hiding this comment.
Is this implementable without a CowString?
Author
There was a problem hiding this comment.
Yes, that's my next patch. I'll change the signature of Callback to say whether it wants to change the string and call ensureOwned on the owning options object before performing the modification.
benlangmuir
approved these changes
Jun 23, 2026
This was referenced Jun 24, 2026
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.
When constructing the dependency graph for compilation caching, the dependency scanner needs to do some extra operations on the compiler invocations. Historically, these have not utilized the copy-on-write variant well. This patch takes care to minimize
CompilerInvocationcopies, which improves incremental scans with populated up-to-date scanning module cache by 16-18%. Together with llvm#203350 which operates in the same space, wall-times are improved by 1.54x and instruction counts by 1.66x.