[PATCH] D58042: [LiveDebugValues] Emit parameter's entry value

Adrian Prantl via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Apr 22 10:10:56 PDT 2019


aprantl added inline comments.


================
Comment at: lib/CodeGen/LiveDebugValues.cpp:211
     bool operator<(const VarLoc &Other) const {
-      if (Var == Other.Var)
-        return Loc.Hash < Other.Loc.Hash;
+      if (Var == Other.Var) {
+        if (Other.Kind == Kind)
----------------
Can you convert this into early-exit form?

```
if (Var != Other.Var)
  return Var < Other.Var;
...
```


================
Comment at: lib/CodeGen/LiveDebugValues.cpp:432
   // TODO: Currently handles DBG_VALUE which has only reg as location.
+  // Also, this handles entry values.
+  VarLoc::VarLocKind K = VarLoc::InvalidKind;
----------------
The combination of TODO and also makes these sentences confusing to me.


================
Comment at: lib/CodeGen/LiveDebugValues.cpp:454
+  for (unsigned ID : KillSet) {
+    if (VarLocIDs[ID].Var.getVar() &&
+        VarLocIDs[ID].Var.getVar()->isParameter()) {
----------------
factor out VarLocIDs[ID] (.Var.getVar()) for readability?


================
Comment at: lib/CodeGen/LiveDebugValues.cpp:455
+    if (VarLocIDs[ID].Var.getVar() &&
+        VarLocIDs[ID].Var.getVar()->isParameter()) {
+      const MachineInstr *CurrDMI = &VarLocIDs[ID].MI;
----------------
```
if (! ...)
  continue
```


================
Comment at: lib/CodeGen/LiveDebugValues.cpp:468
+        continue;
+
+      DIExpression *NewExpr =
----------------
`auto &foo = **DMI;`


================
Comment at: lib/CodeGen/LiveDebugValues.cpp:482
+      TransferDebugPair MIP = {&MI, EntryValDbgMI};
+      Transfers.push_back(MIP);
+      VarLoc VL(*EntryValDbgMI, LS, VarLoc::EntryValueKind);
----------------
`Transfers.push_back({&MI, EntryValDbgMI});`


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

https://reviews.llvm.org/D58042





More information about the llvm-commits mailing list