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

Xiang Zhang via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Nov 18 18:01:20 PST 2020


xiangzhangllvm added inline comments.


================
Comment at: llvm/lib/CodeGen/MachineCheckDebug.cpp:28
+
+struct CheckDebugMachineModule : public ModulePass {
+  bool runOnModule(Module &M) override {
----------------
LuoYuanke wrote:
> Why is it struct, not class?
Struct is similar with "Class", (default to public for its members)
I sync this code from mir-strip-debug pass.


================
Comment at: llvm/lib/CodeGen/MachineDebugify.cpp:58
+      // And there's no meaning to add debug info for a terminator.
+      if (!MI.isTerminator())
+        MI.setDebugLoc(DILocation::get(Ctx, NextLine++, 1, SP));
----------------
LuoYuanke wrote:
> Why terminator instruction don't need debug info?
because later LiveDebugVariables will drops out-of-liveness DBG_VALUEs, as the register allocator will not maintain the location of its vreg for positions that aren't live. 
Pls refer https://github.com/llvm/llvm-project/blob/68ac02c0dd2b8fda52ac132a86f72f2ad6b139a5/llvm/lib/CodeGen/LiveDebugVariables.cpp#L657




CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D91595/new/

https://reviews.llvm.org/D91595



More information about the llvm-commits mailing list