[PATCH] D68209: WIP: [LiveDebugValues] Introduce entry values of unmodified/modified params

Djordje Todorovic via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Sep 30 05:33:57 PDT 2019


djtodoro created this revision.
djtodoro added a project: debug-info.
Herald added subscribers: llvm-commits, ormris, hiraditya.
Herald added a project: LLVM.

NOTE: This patch includes production of entry values for unmodified parameters, and basic support for modified. This relies on D67492 <https://reviews.llvm.org/D67492>.

The idea is to remove front-end analysis for the parameter's value modification and leave it to the value tracking system. Front-end in some cases mark a parameter as modified even the line of code that modifies the parameter gets optimized, that implies that this will cover more entry values even for unmodified parameters (GCC generates entry values in the situations like that, because it performs such analysis within its own value tracking system). In addition, extending the support for modified parameters will be easier with this approach.

Since the goal is to recognize if a parameter’s value has changed, the idea at very high level is: If we encounter a DBG_VALUE other than the entry value one describing the same variable (parameter), we can assume that the variable’s value has changed and we should not track its entry value any more. That would be ideal scenario, but due to various LLVM optimizations, a variable’s value could be just moved around from one register to another (and there will be additional  DBG_VALUEs describing the same variable), so we have to recognize such situation (otherwise, we will lose a lot of entry values) and salvage the debug entry value. In addition, we can sometimes do a similar thing as The LLVM IR Salvage Debug Info system does in some situation. It refers to keeping track of entry value if the modification of a parameter can be expressed in terms of its entry value and a constant (expression as (DW_OP_LLVM_entry_value reg1; DW_OP_plus_uconst, 7, DW_OP_stack_value) where we describe situation like param = param + 7;).

TODOs:

- Test it more
- Improve the code
- Show the stats (debug info and performance)
- Split the unmodified/modified parameters into two patches


https://reviews.llvm.org/D68209

Files:
  llvm/include/llvm/IR/DebugInfoMetadata.h
  llvm/lib/CodeGen/AsmPrinter/DwarfExpression.cpp
  llvm/lib/CodeGen/LiveDebugValues.cpp
  llvm/lib/IR/DebugInfoMetadata.cpp
  llvm/test/DebugInfo/MIR/X86/entry-value-of-modified-param.mir

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D68209.222392.patch
Type: text/x-patch
Size: 20846 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190930/85da06d3/attachment.bin>


More information about the llvm-commits mailing list