[Debugify] Support checking Machine IR debug info
authorXiang1 Zhang <xiang1.zhang@intel.com>
Thu, 17 Dec 2020 04:23:29 +0000 (20:23 -0800)
committerXiang1 Zhang <xiang1.zhang@intel.com>
Thu, 17 Dec 2020 06:17:25 +0000 (22:17 -0800)
commit39584ae5b5cbc817d19499b003d4eaba259c31b5
treec6331693224b4037f59db59a6b9cd2c4891e3321
parent4ad5b634f6834331c526d0a06ade34aa35670d52
[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
16 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/AArch64/GlobalISel/constant-mir-debugify.mir
llvm/test/CodeGen/AArch64/GlobalISel/phi-mir-debugify.mir
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