Commit 22b71b0
Corrected setting IRBuilder debug location in HLSignatureLower::GenerateDxilComputeAndNodeCommonInputs() (#8022)
As a result of
#7799, the HLSL
entry function can now contain `dbg.value` calls with !dbg location
metadata with scopes corresponding to functions which have been inlined.
The `HLSignatureLower::GenerateDxilComputeAndNodeCommonInputs()` creates
`@dx.op.threadId` intrinsic calls, using the default dbg loc when
creating an `IRBuilder`. When the first instruction in the entry block
is one of the `dbg,value` calls, its dbg location is copied to the
`@dx.op.threadId` calls. That makes the DXIL unreadable by the modern
LLVM IR reader since it fails the IR module verification because of !dbg
pointing to a different subprogram scope.
This change sets the dbg location for IRBuilder to be the !dbg node of
the first non-PHI and non-debug instruction in the block.
---------
Co-authored-by: Konstantin <konstantin.pyzhov@amd.com>1 parent bdaeae0 commit 22b71b0
File tree
2 files changed
+26
-0
lines changed- lib/HLSL
- tools/clang/test/HLSLFileCheck/dxil/debug
2 files changed
+26
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1253 | 1253 | | |
1254 | 1254 | | |
1255 | 1255 | | |
| 1256 | + | |
| 1257 | + | |
1256 | 1258 | | |
1257 | 1259 | | |
1258 | 1260 | | |
| |||
Lines changed: 24 additions & 0 deletions
| 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 | + | |
0 commit comments