[PATCH] D55333: VirtRegMap: Preserve LiveDebugVariables

Quentin Colombet via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jan 7 09:50:48 PST 2021


qcolombet added inline comments.


================
Comment at: llvm/lib/CodeGen/VirtRegMap.cpp:273
+    // Write out new DBG_VALUE instructions.
+    DebugVars->emitDebugValues(VRM);
 
----------------
I think we should push the test on `DebugVars` before this block.
Otherwise
1. we won't clear the VRM and MRI when DebugVars are not present.
2. we won't emit the debug values all the time (but maybe that's ok?)

I.e.,
```
if (DebugVars)
  DebugVars->emitDebugValues(VRM).

if (ClearVirtRegs) {
  VRM->clearAllVirt();
  MRI->clearAllVirt();
}
```


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

https://reviews.llvm.org/D55333



More information about the llvm-commits mailing list