[PATCH] D96559: Support emitting complex expressions that include entry values

Vedant Kumar via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Feb 12 16:20:08 PST 2021


vsk added a comment.

It seems reasonable to me to split out AsmPrinter support for complex entry values from the change(s) to start emitting them. @djtodoro any concerns?



================
Comment at: llvm/lib/CodeGen/AsmPrinter/DwarfExpression.cpp:287
   // location, emit it with addBReg and offset 0, because we should emit a DWARF
   // expression representing a value, rather than a location.
+  if ((!isParameterValue() && !isMemoryLocation() && !HasComplexExpression) ||
----------------
Maybe expand the comment with:
+ // Also handle the start of an entry value expression, even if it's complex.


================
Comment at: llvm/test/DebugInfo/MIR/X86/complex-entryvalue.mir:85
+  bb.0.entry:
+    DBG_VALUE $edi, $noreg, !14, !DIExpression(DW_OP_LLVM_entry_value, 1, DW_OP_lit0, DW_OP_plus), debug-location !15
+    frame-setup PUSH64r killed $rbp, implicit-def $rsp, implicit $rsp
----------------
dstenb wrote:
> vsk wrote:
> > Interesting, is 1 code for %rdi? That might be worth a note.
> The 1 is for the number of expression operands (including the DBG_VALUE value operand, i.e. in this case $edi) that the DW_OP_LLVM_entry_value covers. The actual byte size operand of the to-be-emitted DW_OP_entry_value operation is then calculated by `getTemporaryBufferSize()` in `finalizeEntryValue()`.
Sorry about that, I inexplicably skipped over the $edi operand on my first pass through.


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

https://reviews.llvm.org/D96559



More information about the llvm-commits mailing list