[PATCH] D82545: [Debugify] Make the debugify aware of the original (-g) Debug Info

Djordje Todorovic via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jun 25 06:53:19 PDT 2020


djtodoro created this revision.
djtodoro added reviewers: vsk, aprantl, dblaikie, probinson.
djtodoro added projects: LLVM, debug-info.
Herald added subscribers: llvm-commits, ormris, jrtc27, fedor.sergeev, hiraditya, jyknight.
djtodoro added a child revision: D82546: [Debugify][OriginalMode] Export the report into JSON file.

As discussed on the RFC [0], I am sharing the set of patches that enables checking of original Debug Info metadata preservation in optimizations. The proof-of-concept/proposal can be found at [1].

The implementation from the [1] was full of duplicated code, so this set of patches tries to merge this approach into the existing `debugify` utility. The idea is to introduce two modes to the utility:

- `synthetic` - everything should stay as is with the respect to the functionality of the `debugify`
- `original` - this is the new mode that should operate on the original/real Debug Info metadata

For example, the debugify in the original mode could be invoked as follows:

  $ opt -enable-debugify=original -pass-to-test sample.ll

Since this is very initial stage of the implementation, there is a space for improvements such as:

- Add support for the new pass manager
- Add support for metadata other than DILocations and DISubprograms

[0] https://groups.google.com/forum/#!msg/llvm-dev/QOyF-38YPlE/G213uiuwCAAJ
[1] https://github.com/djolertrk/llvm-di-checker


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D82545

Files:
  llvm/docs/HowToUpdateDebugInfo.rst
  llvm/include/llvm/Transforms/Utils/Debugify.h
  llvm/lib/Transforms/Utils/Debugify.cpp
  llvm/test/DebugInfo/check-debugify-preserves-analyses.ll
  llvm/test/DebugInfo/debugify-each-original-dbginfo.ll
  llvm/test/DebugInfo/debugify-each.ll
  llvm/test/DebugInfo/debugify-export.ll
  llvm/test/DebugInfo/debugify-original-dbginfo.ll
  llvm/test/DebugInfo/debugify-original-no-dbg-info.ll
  llvm/test/DebugInfo/debugify.ll
  llvm/test/DebugInfo/pr37964.ll
  llvm/test/Transforms/CodeGenPrepare/AArch64/overflow-intrinsics.ll
  llvm/test/Transforms/CodeGenPrepare/SPARC/overflow-intrinsics.ll
  llvm/test/Transforms/CodeGenPrepare/X86/overflow-intrinsics.ll
  llvm/test/Transforms/CodeGenPrepare/X86/vec-shift.ll
  llvm/test/Transforms/CorrelatedValuePropagation/ashr.ll
  llvm/test/Transforms/CorrelatedValuePropagation/overflows.ll
  llvm/test/Transforms/CorrelatedValuePropagation/sext.ll
  llvm/test/Transforms/CorrelatedValuePropagation/udiv.ll
  llvm/test/Transforms/InstCombine/call-guard.ll
  llvm/test/Transforms/InstCombine/double-float-shrink-2.ll
  llvm/test/Transforms/InstCombine/malloc-free-delete-dbginvar.ll
  llvm/test/Transforms/InstCombine/musttail-thunk.ll
  llvm/test/Transforms/SCCP/ipsccp-basic.ll
  llvm/tools/opt/opt.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D82545.273325.patch
Type: text/x-patch
Size: 57367 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200625/b31f5105/attachment-0001.bin>


More information about the llvm-commits mailing list