[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
Thu Apr 1 18:53:17 PDT 2021


dongAxis1944 added inline comments.


================
Comment at: llvm/lib/CodeGen/InlineSpiller.cpp:979
+      if (CopyReg.isValid())
+        TryKillReg();
       HSpiller.addToMergeableSpills(*FoldMI, StackSlot, Original);
----------------
probinson wrote:
> jmorse wrote:
> > dongAxis1944 wrote:
> > > @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?
> > Interesting -- I'm not very familiar with the kill flags, I've always relied on analysis passes to determine liveness information. If it's legitimate to place a a kill flag here, and it improves variable location tracking like you suggested in D41226, then it's probably a worthwhile improvement.
> > 
> > However, you should first check whether this causes LLVM to ever generate different code. I think most of the community doesn't want to change the code generated simply to improve debug-info (unless it's a trivial alteration).
> What we don't like is when adding -g changes codegen at all. Making slightly different choices (at -O0) that gives better debug experience without particularly affecting performance is okay, as long as that choice doesn't depend on the presence of debug info.
@probinson thanks, I will check whether the change will affect the performance.


================
Comment at: llvm/lib/CodeGen/InlineSpiller.cpp:979
+      if (CopyReg.isValid())
+        TryKillReg();
       HSpiller.addToMergeableSpills(*FoldMI, StackSlot, Original);
----------------
dongAxis1944 wrote:
> probinson wrote:
> > jmorse wrote:
> > > dongAxis1944 wrote:
> > > > @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?
> > > Interesting -- I'm not very familiar with the kill flags, I've always relied on analysis passes to determine liveness information. If it's legitimate to place a a kill flag here, and it improves variable location tracking like you suggested in D41226, then it's probably a worthwhile improvement.
> > > 
> > > However, you should first check whether this causes LLVM to ever generate different code. I think most of the community doesn't want to change the code generated simply to improve debug-info (unless it's a trivial alteration).
> > What we don't like is when adding -g changes codegen at all. Making slightly different choices (at -O0) that gives better debug experience without particularly affecting performance is okay, as long as that choice doesn't depend on the presence of debug info.
> @probinson thanks, I will check whether the change will affect the performance.
@jmorse Thanks, let me check the generated code when applying this patch first.


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

https://reviews.llvm.org/D99048



More information about the llvm-commits mailing list