Page MenuHomePhabricator

[Debugify] Make the debugify aware of the original (-g) Debug Info
Needs ReviewPublic

Authored by djtodoro on Jun 25 2020, 6:31 AM.

Details

Summary

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

Diff Detail

Event Timeline

djtodoro created this revision.Jun 25 2020, 6:31 AM
djtodoro updated this revision to Diff 274430.Jun 30 2020, 5:15 AM
  • Fix an assertion
  • Define the debugify DEBUG_TYPE macro
djtodoro updated this revision to Diff 276396.Jul 8 2020, 6:00 AM
djtodoro updated this revision to Diff 277777.Jul 14 2020, 4:30 AM
  • Rebase
  • TODO: Consider another name for mode. 'original' might be too sharp.

Hi @vsk, is this in better shape now? :)