[all-commits] [llvm/llvm-project] 5c7cc6: [LiveDebugValues] Omit entry values for DBG_VALUEs...

David via All-commits all-commits at lists.llvm.org
Fri Dec 13 02:01:02 PST 2019


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: 5c7cc6f83d1f3ea2016d94e1c9cc25f814d2671b
      https://github.com/llvm/llvm-project/commit/5c7cc6f83d1f3ea2016d94e1c9cc25f814d2671b
  Author: David Stenberg <david.stenberg at ericsson.com>
  Date:   2019-12-13 (Fri, 13 Dec 2019)

  Changed paths:
    M llvm/lib/CodeGen/LiveDebugValues.cpp
    A llvm/test/DebugInfo/MIR/X86/dbgcall-site-reference.mir

  Log Message:
  -----------
  [LiveDebugValues] Omit entry values for DBG_VALUEs with pre-existing expressions

Summary:
This is a quickfix for PR44275. An assertion that checks that the
DIExpression is valid failed due to attempting to create an entry value
for an indirect parameter. This started appearing after D69028, as the
indirect parameter started being represented using an DW_OP_deref,
rather than with the DBG_VALUE's second operand, meaning that the
isIndirectDebugValue() check in LiveDebugValues did not exclude such
parameters. A DIExpression that has an entry value operation can
currently not have any other operation, leading to the failed isValid()
check.

This patch simply makes us stop considering emitting entry values
for such parameters. To support such cases I think we at least need
to do the following changes:

 * In DIExpression::isValid(): Remove the limitation that a
   DW_OP_LLVM_entry_value operation can be the only operation in a
   DIExpression.

 * In LiveDebugValues::emitEntryValues(): Create an entry value of size
   1, so that it only wraps the register operand, and not the whole
   pre-existing expression (the DW_OP_deref).

 * In LiveDebugValues::removeEntryValue(): Check that the new debug
   value has the same debug expression as the original, rather than
   checking that the debug expression is empty.

 * In DwarfExpression::addMachineRegExpression(): Modify the logic so
   that a DW_OP_reg* expression is emitted for the entry value.
   That is how GCC emits entry values for indirect parameters. That will
   currently not happen to due the DW_OP_deref causing the
   !HasComplexExpression to fail. The LocationKind needs to be changed
   also, rather than always emitting a DW_OP_stack_value for entry values.

There are probably more things I have missed, but that could hopefully
be a good starting point for emitting such entry values.

Reviewers: djtodoro, aprantl, jmorse, vsk

Reviewed By: aprantl, vsk

Subscribers: hiraditya, llvm-commits

Tags: #debug-info, #llvm

Differential Revision: https://reviews.llvm.org/D71416




More information about the All-commits mailing list