Repository navigation
Commit 49b2b00
Fix missing inlinedAt on localized global debug info
Since microsoft#7799, PatchDebugInfo() creates a DILocalVariable and dbg.declare
for every subprogram on the inlined-at chain of a localized global's
users. The declare's location is built from just the global's line and
that subprogram as scope, without the inlinedAt the subprogram was
inlined at. For any subprogram other than the function itself, that
location points at a different subprogram than the function holding
the declare, which the LLVM verifier rejects:
!dbg attachment points at wrong subprogram for function
Later passes propagate the location from those declares onto the
dbg.value and dx.op.annotateHandle instructions that replace them, so
DXIL with -Zi carries these broken locations for every static global
read in an inlined function. Drivers that verify the module, e.g. when
linking ray tracing libraries into a state object, print the error for
each one.
Collect each subprogram together with the location it is inlined at,
and give every declare that inlinedAt. A subprogram inlined at several
call sites keeps a single variable with one declare per inlined
instance, rather than a duplicate variable per call site.
Fixes microsoft#8592
Co-Authored-By: Claude Opus 5.5 <[email protected]>1 parent 17d9afb commit 49b2b00
2 files changed
Lines changed: 58 additions & 11 deletions
File tree
- lib/Transforms/Scalar
- tools/clang/test/HLSLFileCheck/dxil/debug
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6527 | 6527 | | |
6528 | 6528 | | |
6529 | 6529 | | |
6530 | | - | |
6531 | | - | |
| 6530 | + | |
| 6531 | + | |
| 6532 | + | |
| 6533 | + | |
| 6534 | + | |
6532 | 6535 | | |
6533 | 6536 | | |
6534 | | - | |
| 6537 | + | |
6535 | 6538 | | |
6536 | 6539 | | |
6537 | 6540 | | |
| |||
6776 | 6779 | | |
6777 | 6780 | | |
6778 | 6781 | | |
6779 | | - | |
| 6782 | + | |
6780 | 6783 | | |
6781 | 6784 | | |
6782 | | - | |
| 6785 | + | |
6783 | 6786 | | |
6784 | 6787 | | |
6785 | 6788 | | |
6786 | 6789 | | |
6787 | 6790 | | |
6788 | 6791 | | |
6789 | | - | |
6790 | | - | |
6791 | | - | |
6792 | | - | |
6793 | | - | |
6794 | | - | |
| 6792 | + | |
| 6793 | + | |
| 6794 | + | |
| 6795 | + | |
| 6796 | + | |
| 6797 | + | |
| 6798 | + | |
| 6799 | + | |
| 6800 | + | |
| 6801 | + | |
| 6802 | + | |
| 6803 | + | |
| 6804 | + | |
| 6805 | + | |
6795 | 6806 | | |
6796 | 6807 | | |
6797 | 6808 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
0 commit comments