[Debugify] Support checking Machine IR debug info
authorXiang1 Zhang <xiang1.zhang@intel.com>
Tue, 15 Dec 2020 01:51:21 +0000 (17:51 -0800)
committerXiang1 Zhang <xiang1.zhang@intel.com>
Tue, 15 Dec 2020 01:53:46 +0000 (17:53 -0800)
commitc4d2d4337d50bed3cafd564daece1a197005b22b
treed8d0db8f55a3b3a7c0dfa3526ee3152929435c21
parentb1067a9b3c8e2c692c31598bf8f399e31f486d4e
[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/D91595
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