[llvm-dev] [RFC] [DebugInfo] Using DW_OP_entry_value within LLVM IR

Jeremy Morse via llvm-dev llvm-dev at lists.llvm.org
Thu Sep 10 04:38:57 PDT 2020


Hi Djordje,

On Thu, Sep 10, 2020 at 12:04 PM Djordje Todorovic
<Djordje.Todorovic at syrmia.com> wrote:
> The entry-values-as-"backups" could be used this way, but we firstly need to have the DBG_INSTR_REF in use. I don't see an overlapping with the way I suggested for current "non-ref-dbg-values" at MIR. (?)

Indeed, there's no overlap between these two ideas -- yours is
producing expressions early and consuming late, while mine is both
producing and consuming late. Hence I wanted to get the idea out for
discussion before either are really pursued.

> This will be an improvement of the DBG_INSTR_REF, since it needs the variadic form of the instruction; and we don't have it at the moment? As you have pointed out, by having the variadic form of the instruction, we can salvage "non-entry" values as well, I guess.

Indeed, although I think it'll be a bit easier than Stephens
DBG_VALUE_LIST implementation, as the locations won't need maintenance
through the rest of CodeGen -- we would only need to generate
DBG_INSTR_REFs with multiple operands, then consider them at the end
of compilation.

A note on timescales, I don't see any of the instruction-referencing
work as likely to be "on by default" any time soon. It'll need some
comprehensive testing on large binaries, plus GlobalISel and aarch64
support, which I haven't thought about so far. It's worth pointing out
that producing backup entry values is something that could be
implemented and work almost immediately, and deliver benefits in the
next release, wheras the late-salvaging way definitely has a long
horizon.

--
Thanks,
Jeremy


More information about the llvm-dev mailing list