[DWARFLinker] Make synthetic type names deterministic under threading - #209553
Merged
JDevlieghere merged 1 commit intoJul 19, 2026
Conversation
🐧 Linux x64 Test Results
✅ The build succeeded and all tests passed. |
JDevlieghere
force-pushed
the
dsymutil-synthetic-typenames
branch
from
July 15, 2026 05:13
fa5a1af to
029b3e3
Compare
Member
Author
|
Friendly (early) ping as I'd really love to backport this into 23.x. |
JDevlieghere
force-pushed
the
dsymutil-synthetic-typenames
branch
from
July 16, 2026 23:03
029b3e3 to
08a92e5
Compare
The parallel DWARF linker assigns type names concurrently across
compile units. SyntheticTypeNameBuilder::addDIETypeName composes a
type's name from its referenced types (e.g. template arguments).
For a referenced type it either appends that type's fully-qualified
pool key, when the type has already been assigned a type entry, or
recomputes the name inline. The inline path only prepended the parent
scope when AssignNameToTypeDescriptor was set, so an embedded
reference came out fully-qualified when the referenced type happened
to be assigned already and unqualified otherwise.
Which branch runs depends on the order type names are assigned, and
that order races during the parallel assignment phase. The same type
then gets different synthetic names across runs, is entered into the
type pool under different keys, and no longer deduplicates
deterministically.
Two threaded runs of the same input:
...EventInstance:()<{1}CMEvent.{1}detail.{F}Group:()<...>>
...EventInstance:()<{F}Group:()<...>>
Always qualify with the parent scope regardless of
AssignNameToTypeDescriptor so the inline path agrees with the stored
key. Assignment to the type pool stays gated on the flag.
This removes essentially all of the run-to-run type-unit divergence
on a large threaded link.
JDevlieghere
force-pushed
the
dsymutil-synthetic-typenames
branch
from
July 17, 2026 14:55
08a92e5 to
37bd5cd
Compare
|
LLVM Buildbot has detected a new failure on builder Full details are available at: https://lab.llvm.org/buildbot/#/builders/59/builds/35880 Here is the relevant piece of the build log for the reference |
Member
Author
|
/cherry-pick 6bcdcb3 |
Member
|
Failed to cherry-pick: 6bcdcb3 https://github.com/llvm/llvm-project/actions/runs/29783312580 Please manually backport the fix and push it to your github fork. Once this is done, please create a pull request |
Member
Author
|
/cherry-pick 6bcdcb3 |
Member
|
/pull-request #210834 |
dyung
pushed a commit
to llvmbot/llvm-project
that referenced
this pull request
Jul 22, 2026
…llvm#209553) (cherry picked from commit 6bcdcb3)
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.
The parallel DWARF linker assigns type names concurrently across compile units. SyntheticTypeNameBuilder::addDIETypeName composes a type's name from its referenced types (e.g. template arguments).
For a referenced type it either appends that type's fully-qualified pool key, when the type has already been assigned a type entry, or recomputes the name inline. The inline path only prepended the parent scope when AssignNameToTypeDescriptor was set, so an embedded reference came out fully-qualified when the referenced type happened to be assigned already and unqualified otherwise.
Which branch runs depends on the order type names are assigned, and that order races during the parallel assignment phase. The same type then gets different synthetic names across runs, is entered into the type pool under different keys, and no longer deduplicates deterministically.
Two threaded runs of the same input:
Always qualify with the parent scope regardless of AssignNameToTypeDescriptor so the inline path agrees with the stored key. Assignment to the type pool stays gated on the flag.