[PATCH] D99048: [RFC][DebugInfo] Do not use the DBG_VALUE to calculate debug info of spill location

Yifeng Dong via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Mar 30 01:51:14 PDT 2021


dongAxis1944 added inline comments.


================
Comment at: llvm/lib/CodeGen/InlineSpiller.cpp:979
+      if (CopyReg.isValid())
+        TryKillReg();
       HSpiller.addToMergeableSpills(*FoldMI, StackSlot, Original);
----------------
@jmorse In addition, when regalloc tries to spill vreg to stack. llvm forget to mark kill flags for copy instruction. I think it might be useful for dwarf construction. What's your opinions?


================
Comment at: llvm/lib/CodeGen/LiveDebugValues/VarLocBasedImpl.cpp:1313
       })) {
-    // Use normal VarLoc constructor for registers and immediates.
-    VarLoc VL(MI, LS);
-    // End all previous ranges of VL.Var.
-    OpenRanges.erase(VL);
+    if (!MI.isIndirectDebugValue()) {
+      // Use normal VarLoc constructor for registers and immediates.
----------------
jmorse wrote:
> dongAxis1944 wrote:
> > dongAxis1944 wrote:
> > > @jmorse If the MI is indirect DBG_VALUE, does it mean the positions of variable is in the stack?
> > I just want to skip the DBG_VALUE related to the spill location. Because I find the function "VarLocBasedLDV::transferSpillOrRestoreInst" can handle spill location well
> (The "isIndirect" flag is quite a pain, and hopefully it'll be eliminated when everything becomes DBG_VALUE_LIST instructions in the coming few months,)
> 
> Right now isIndirect does indeed mean the variable is on the stack -- as opposed to the variable being the stack _pointer_. Alas, we can't just ignore these DBG_VALUEs as we'll drop numerous variable locations. Pre-regalloc DBG_VALUEs of a vreg translate into indirect DBG_VALUEs when that vreg is placed on the stack at the position of the DBG_VALUE.
> 
> This is different to following a variable that's in a register onto and off-of the stack via transferSpillOrRestoreInst; it's a variable that is assigned a value that is on the stack at that time.
thank you very much


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

https://reviews.llvm.org/D99048



More information about the llvm-commits mailing list