[llvm-dev] DBG_VALUE / DBG_VALUE_LIST handling when moving/cloning instructions

Jeremy Morse via llvm-dev llvm-dev at lists.llvm.org
Wed May 12 12:12:55 PDT 2021


Hi,

On Wed, May 12, 2021 at 4:48 AM Heejin Ahn <aheejin at gmail.com> wrote:
> Thanks for the reply! Given that our DebugValueManager does not handle DBG_VALUE_LIST correctly now, is there a way to disable generation of DBG_VALUE_LIST instruction or list version of dbg.value.list intrinsic in IR?

Not at the moment, and as we're aiming to enhance more passes to emit
DBG_VALUE_LISTs it probably wouldn't last long. There's a better fix
(see below),

>> Doing this for multiple registers in DBG_VALUE_LIST is much harder. If
>> it's too difficult, then it's safe to drop the DBG_VALUE_LIST by
>> making it's register operands $noreg. That should turn into "optimised
>> out" when seen by a debugger.
>
> Can this also be achieved as just deleting the DBG_VALUE_LIST instruction, or is this going to lose even more info?

Unfortunately deleting isn't safe. Instead, it's safe to replace any
DBG_VALUE_LIST you see with "DBG_VALUE $noreg". This indicates that
there _was_ a variable assignment here, but its value could not be
recovered. Taking that approach won't harm variable location coverage
at all: all the DBG_VALUE_LISTs produced would have been "DBG_VALUE
$noreg" in the past.

--
Thanks,
Jeremy


More information about the llvm-dev mailing list