KhronosGroup / SPIRV-Registry

SPIR-V specs

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

NonSemantic.Shader.DebugInfo.100 & DebugGlobalVariable's Variable field

LU-JOHN opened this issue · comments

The NonSemantic.Shader.DebugInfo.100 describes DebugGlobalVariable's Variable field as:

Variable is the of the source global variable or constant that is described by this instruction. If the variable is optimized out, this operand must be DebugInfoNone.

Sometimes when the variable is optimized out, we would like to utilize this field to hold an Expression that contains the constant value of the variable that was optimized out. Is this modification okay?

This change is motivated by llvm/llvm-project#71780 which generates code like:

!5 = !DIGlobalVariableExpression(var: !6, expr: !DIExpression(DW_OP_constu, 1, DW_OP_stack_value))
!6 = distinct !DIGlobalVariable(name: "true", scope: !2, file: !3, line: 3, type: !7, isLocal: true, isDefinition: true)

This change will allow preservation of the DIExpression.

Since we've merged #231 is there anything more to do for this issue? Thanks!