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.

@damyanp
Copy link
Member

damyanp commented Dec 29, 2025

@adam-yang - can you have a look at this when you get a chance please?

@kpyzhov - it seems like there may be some kind of a testing hole that we should fill along with this fix?

Copy link
Contributor

@adam-yang adam-yang left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Thank you!

@kpyzhov
Copy link
Author

kpyzhov commented Jan 6, 2026

@adam-yang, can you approve it again please? Thanks!

Copy link
Contributor

@adam-yang adam-yang left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

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.

3 participants