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?
The NonSemantic.Shader.DebugInfo.100 describes DebugGlobalVariable's Variable field as:
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 https://github.com/llvm/llvm-project/pull/71780 which generates code like:
This change will allow preservation of the DIExpression.