In the DebugGlobalVariable spec it says
Variable can hold two kinds of values. First it can hold the of the source global variable or constant that is described by this instruction. If the variable is optimized out, this operand can be the of a DebugExpression instruction that contains the constant value of the variable that was optimized out. Otherwise this operand must be DebugInfoNone.
I was trying to find an example of it using DebugExpression, but looking at spirv-val it doesn't even allow DebugExpression, it only allows
OpVariable result ID
DebugInfoNone
OpConstant (and variants)
So not sure if the spec is wrong or spirv-val
cc @dnovillo as you are probably knee deep in this stuff