This is an archive of the discontinued LLVM Phabricator instance.

[DebugInfo][InstrRef] Account for additional indirection from dbg.declares in SelectionDAG

Authored by jmorse on Nov 23 2021, 7:23 AM.



Usually dbg.declares get translated into either entries in an MF side-table, or a DBG_VALUE on entry to the function with IsIndirect set (including in instruction referencing mode). Much rarer is a dbg.declare attached to a non-argument value, such as in the test added in this patch where there's a variable-length-array. Such dbg.declares become SDDbgValue nodes with InIndirect=true.

As it happens, we weren't correctly emitting DBG_INSTR_REFs with the additional indirection. This patch adds the extra indirection, encoded as adding an additional DW_OP_deref to the expression. Adds test too.

Diff Detail