[Debugify] Support checking Machine IR debug info
authorXiang1 Zhang <xiang1.zhang@intel.com>
Tue, 15 Dec 2020 01:28:34 +0000 (17:28 -0800)
committerXiang1 Zhang <xiang1.zhang@intel.com>
Tue, 15 Dec 2020 01:38:01 +0000 (17:38 -0800)
commit57a3d9ec4a8c1422f07264bed9f12a4ea416707e
tree02480c3430954dc4c14483eafa27b3ef1fe0a507
parentb094eaa392322a9a0073c84f0b6ea320d80dafcf
[Debugify] Support checking Machine IR debug info
Add mir-check-debug pass to check MIR-level debug info.

For IR-level, currently, LLVM have debugify + check-debugify to generate
and check debug IR. Much like the IR-level pass debugify, mir-debugify
inserts sequentially increasing line locations to each MachineInstr in a
Module, But there is no equivalent MIR-level check-debugify pass, So now
we support it at "mir-check-debug".

Reviewed By: djtodoro

Differential Revision: https://reviews.llvm.org/D95195
14 files changed:
llvm/docs/HowToUpdateDebugInfo.rst
llvm/include/llvm/CodeGen/Passes.h
llvm/include/llvm/CodeGen/TargetPassConfig.h
llvm/include/llvm/InitializePasses.h
llvm/lib/CodeGen/CMakeLists.txt
llvm/lib/CodeGen/CodeGen.cpp
llvm/lib/CodeGen/MachineCheckDebugify.cpp [new file with mode: 0644]
llvm/lib/CodeGen/MachineDebugify.cpp
llvm/lib/CodeGen/TargetPassConfig.cpp
llvm/test/CodeGen/Generic/MIRDebugify/check-line-and-variables-x.mir [new file with mode: 0644]
llvm/test/CodeGen/Generic/MIRDebugify/check-line-and-variables.ll [new file with mode: 0644]
llvm/test/CodeGen/Generic/MIRDebugify/check-line-and-variables.mir [new file with mode: 0644]
llvm/test/CodeGen/Generic/MIRDebugify/locations-and-values.mir
llvm/utils/gn/secondary/llvm/lib/CodeGen/BUILD.gn