[PATCH] D91595: [Debug] Support checking Machine IR debug info

Xiang Zhang via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Nov 17 00:58:21 PST 2020


xiangzhangllvm created this revision.
xiangzhangllvm added reviewers: LuoYuanke, pengfei, jmorse, craig.topper, MaskRay, annita.zhang.
Herald added subscribers: llvm-commits, hiraditya, mgorny.
Herald added a project: LLVM.
xiangzhangllvm requested review of this revision.

Add mir-check-debug pass to check MIR-level debug info.

For  IR-level, currently, LLVM have **debugify** + **check-debugify** to generate 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**".

Currently (our first step), what **mir-check-debug** do is similar with **check-debugify**, to check the integrity of line info in DILocation and DILocalVariable
which **mir-debugify** generated before.

The 3 tests in patch show how this tools work.


https://reviews.llvm.org/D91595

Files:
  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/MachineCheckDebug.cpp
  llvm/lib/CodeGen/MachineDebugify.cpp
  llvm/lib/CodeGen/TargetPassConfig.cpp
  llvm/test/CodeGen/Generic/MIRDebugify/check-line-and-variables-x.mir
  llvm/test/CodeGen/Generic/MIRDebugify/check-line-and-variables.ll
  llvm/test/CodeGen/Generic/MIRDebugify/check-line-and-variables.mir
  llvm/test/CodeGen/Generic/MIRDebugify/locations-and-values.mir
  llvm/utils/gn/secondary/llvm/lib/CodeGen/BUILD.gn

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D91595.305666.patch
Type: text/x-patch
Size: 24232 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20201117/3a156c35/attachment.bin>


More information about the llvm-commits mailing list