This is an archive of the discontinued LLVM Phabricator instance.

[DebugInfo] Support for DW_OP_implicit_pointer (for InstComb optimization)
Needs ReviewPublic

Authored by alok on Nov 18 2019, 8:47 PM.

Details

Summary

This patch (9/N) stems from D69787

Summary:
  This modification should include most optimizations under the scope of DW_OP_implicit_pointer, though only InstComb optimization has been validated.

  It makes more sense to give a try to preserve debug info whenever an instruction is being erased. In place of doing salvaging before any call-site where Instruction::eraseFromParent is being called, this modification makes salvaging part of deletion method itself. To do this salvaging methods have been moved from file Transforms/Utils/Local.cpp to files llvm/lib/IR/Instruction.cpp and llvm/lib/IR/Value.cpp

Testing:
  - Added unit tests for validation of LLVM IR and object file thru llvm-dwarfdump
  - check-llvm, and an end-to-end test using gnu GDB to debug an optimized
     program (LLDB need to be enhanced to support).
  - check-debuginfo (the debug info integration tests)

Diff Detail