Skip to content

Conversation

@kpyzhov
Copy link

@kpyzhov kpyzhov commented Dec 25, 2025

…ateDxilComputeAndNodeCommonInputs()

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: New

Development

Successfully merging this pull request may close these issues.

1 participant