[PATCH] D111317: [DebugInfo][InstrRef] Track instructions that write-to-stack after having a spill fused into them

Jeremy Morse via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Oct 12 01:53:56 PDT 2021


jmorse added a comment.

In D111317#3057344 <https://reviews.llvm.org/D111317#3057344>, @djtodoro wrote:

> this actually becomes `DBG_INSTR_REF 2, 0`, right?

Actually no -- when optimisations are occurring with instruction referencing, I'm recording them in the "debugValueSubstitutions" table, which maps "old" instruction numbers onto new. Take a look at the MIR in memory-operand-tracking.mir which is added by this patch; there's a substitution from "2, 0" to "3, 1000000" (the large number signifying the memory operand).

Because instruction referencing gets rid of virtual register references, there's no efficient way to find the debug instructions that use a particular instruction number; perhaps we could make that happen, but I don't think we would gain anything from it. That's why I'm storing records of substitutions in a side-table, they're used to "patch up" the DBG_INSTR_REFs at the end of compilation.

(One downside of this approach is it adds extra steps for humans interpreting the debug-info, because they might have to interpret the substitutions; we could "patch up" DBG_INSTR_REFs as part of the printing process if that becomes a burden).


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D111317/new/

https://reviews.llvm.org/D111317



More information about the llvm-commits mailing list