[PATCH] D88405: [LiveDebugValues][InstrRef][1/2] Try harder to recover clobbered variable locations

Jeremy Morse via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Sep 30 07:39:23 PDT 2020


jmorse marked an inline comment as done.
jmorse added inline comments.


================
Comment at: llvm/lib/CodeGen/LiveDebugValues/InstrRefBasedImpl.cpp:1139
+  void clobberMloc(LocIdx MLoc, MachineBasicBlock::iterator Pos,
+                   bool make_undef = true) {
     auto ActiveMLocIt = ActiveMLocs.find(MLoc);
----------------
aprantl wrote:
> this seems to be always called with `false`? Does that mean the second half is untested?
There's a call to clobberMloc with the default argument (true) on lines (pre) 1735 / (post) 1798 of this patch. The background to this is D66941, spill slots can be merged, and DbgEntityHistoryCalculator doesn't terminate any variable locations when the stack is written to, so LiveDebugValues has to explicitly terminate (with DBG_VALUE $noreg) any variable locations clobbered by stack writes. (Eww).

The test for D66941 should stimulate the code path through line 1798, as it needs an explicit DBG_VALUE $noreg to be generated by LiveDebugValues.

(This is another thing that would fixed by refactoring this responsibility into / with DbgEntityHistoryCalculator; I'm deep in the tar pit here, horray).


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D88405



More information about the llvm-commits mailing list