Repository navigation
debug: preserve supported thin-pointer pointee types - #1126
Merged
Merged
Conversation
Carry a required pointee debug type for the proven thin raw-pointer and reference subset so LLVM emits a non-null DWARF baseType. Retain the existing opaque pointer metadata for fat, composite/cyclic, and otherwise unsupported pointees so their variables remain visible without claiming unsupported structure. Signed-off-by: nihalp <[email protected]>
nihalpasham
marked this pull request as ready for review
August 28, 2026 11:23
nihalpasham
added a commit
that referenced
this pull request
Aug 28, 2026
Reworked onto main's #1186 device-global declaration cache: debug identity rides DeviceGlobalDeclaration as an equality-checked field instead of a parallel record type, the promoted-key fingerprint keeps main's align component under the domain tag, and the encoder covers the TypedPointer debug type from #1126. Signed-off-by: nihalp <[email protected]>
nihalpasham
added a commit
that referenced
this pull request
Aug 28, 2026
* debug: describe AS1 device globals Reworked onto main's #1186 device-global declaration cache: debug identity rides DeviceGlobalDeclaration as an equality-checked field instead of a parallel record type, the promoted-key fingerprint keeps main's align component under the domain tag, and the encoder covers the TypedPointer debug type from #1126. Signed-off-by: nihalp <[email protected]> * fix(mir): keep mixed-pointee reference unions valid as device-static storage #1186 tightened classify_union_constant_storage so SharedRef union alternatives with different pointee types fail closed. That is right for SSA reconstruction, which mints the carrier field's own reference type and could claim validity for a pointee the program never wrote. But the device-static initializer gate shares the classifier while emitting only exact bytes plus one integer-width relocation slot; no typed reference is ever minted, and device code reads the storage through its own field types. Release builds hid the regression because optimized MIR folds the example's union load away; any unoptimized device build (including CUDA_OXIDE_DEBUG=full) materializes the static and failed to compile device_global's documented union { word: &'static u32, byte: &'static u8 } shape. Thread a UnionConstantUse through the classifier so the SSA path keeps the pointee-identity rejection and the physical-storage gate does not, and cover the SharedRef mixed-pointee shape at both call sites. Signed-off-by: nihalp <[email protected]> --------- Signed-off-by: nihalp <[email protected]>
nihalpasham
added a commit
that referenced
this pull request
Aug 28, 2026
Reworked onto main's #1186 shared-globals cache: the debug identity (variable info plus owner function) rides SharedGlobalDeclaration next to the storage fields, physical mismatches keep main's incompatible- declaration error, and divergent debug identities on one alloc_key now fail open by dropping the attachment instead of failing full-debug builds that release accepts. The physical gate uses llvm_type_size_align (get_type_size was removed by #1186), the owner subprogram cache is keyed by the exported linkage name to compose with #1127's source/ linkage split, and typed thin pointers from #1126 are admitted through the shared debug-type gate. Signed-off-by: nihalp <[email protected]>
4 of 5 tasks
nihalpasham
added a commit
that referenced
this pull request
Aug 28, 2026
Reworked onto main's #1186 shared-globals cache: the debug identity (variable info plus owner function) rides SharedGlobalDeclaration next to the storage fields, physical mismatches keep main's incompatible- declaration error, and divergent debug identities on one alloc_key now fail open by dropping the attachment instead of failing full-debug builds that release accepts. The physical gate uses llvm_type_size_align (get_type_size was removed by #1186), the owner subprogram cache is keyed by the exported linkage name to compose with #1127's source/ linkage split, and typed thin pointers from #1126 are admitted through the shared debug-type gate. Signed-off-by: nihalp <[email protected]>
nihalpasham
added a commit
that referenced
this pull request
Aug 28, 2026
Reworked onto main's #1186 shared-globals cache: the debug identity (variable info plus owner function) rides SharedGlobalDeclaration next to the storage fields, physical mismatches keep main's incompatible- declaration error, and divergent debug identities on one alloc_key now fail open by dropping the attachment instead of failing full-debug builds that release accepts. The physical gate uses llvm_type_size_align (get_type_size was removed by #1186), the owner subprogram cache is keyed by the exported linkage name to compose with #1127's source/ linkage split, and typed thin pointers from #1126 are admitted through the shared debug-type gate. Signed-off-by: nihalp <[email protected]>
4 of 5 tasks
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.
Summary
cuda-gdb can now see and dereference the pointee type for the thin pointers we
can describe safely.
whatis ptr*mut ()*mut i32print *ptr10Closes #1119.
Changes
baseType.references.
pointees so existing variables do not disappear.
This is deliberately partial: slices, trait objects, and recursive composite
types still need richer graph/fat-pointer metadata.
Testing
llvm-exportandmir-importerfull suites, strict Clippy, formatting,llvm-as, andoptpassed.CUDA 13.3 / RTX 5090: T06/T19 now show
*mut i32/*mut f32anddereference correctly; unsupported T07/T15 variables remain visible.
just checkpasses (affected suites pass)Live GPU debugger regression exercised
New example added (not needed; focused regression added)
Checklist
git commit -s)