[llvm-dev] DW_OP_implicit_pointer design/implementation in general

Adrian Prantl via llvm-dev llvm-dev at lists.llvm.org
Wed Jan 8 12:38:45 PST 2020



> On Jan 2, 2020, at 6:37 AM, Jeremy Morse <jeremy.morse.llvm at gmail.com> wrote:
> 
> Hi all,
> 
> On the topic of intrinsics, right now we have two (dbg.value /
> dbg.addr) that respectively describe:
> * The "direct value" (quoting langref) of a variable, and
> * The address of where the current variable value is stored.
> Both of which map onto dwarf locations later on. My reasoning for
> wanting a new intrinsic is that implicit pointers are neither of these
> things: what is being described is an entirely new domain of
> information about the variable, i.e. what it points at. To me that's a
> major difference from a "direct value", and something to signal at an
> early stage to any consumer wishing to interpret debug intrinsics,
> rather than having consumers interpret the DIExpression to discover
> whether this is actually the variable value or not.

As far as LLVM semantics are concerned, the implicit pointer doesn't seem to be that much different from any other implicit values (such as constants) to me. Why do you think that it needs to be represented differently inside of LLVM IR?

-- adrian

> The counter-argument would be that, in reality, dbg.value is used to
> represent everything about with variables and their values, any other
> debug intrinsic is likely to be dropped by optimisations, and you
> usually have to interpret the DIExpression anyway.
> 
> IMO, having a new intrinsic would be conceptually neater; that
> neatness might not have a lot of practical value though. I'm not
> familiar with LLVMs long term compatibility guarantees when it comes
> to intrinsics, so maybe it's more trouble than it's worth.
> 
> --
> Thanks,
> Jeremy



More information about the llvm-dev mailing list