[PATCH] D68209: [LiveDebugValues] Introduce entry values of unmodified params

David Stenberg via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Oct 15 03:11:57 PDT 2019


dstenb added inline comments.


================
Comment at: llvm/lib/CodeGen/LiveDebugValues.cpp:94-99
+  MachineFunction *MF = MI.getParent()->getParent();
+  const TargetLowering *TLI = MF->getSubtarget().getTargetLowering();
+  unsigned SP = TLI->getStackPointerRegisterToSaveRestore();
+  Register FP = TRI->getFrameRegister(*MF);
+
+  return Op.isReg() && Op.getReg() != SP && Op.getReg() != FP;
----------------
As a performance optimization, perhaps consider an early exit like this:

```
if (!Op.isReg())
  return false;
```

to avoid running the query functions if not needed.



================
Comment at: llvm/lib/CodeGen/LiveDebugValues.cpp:270
+    /// Take the variable and the entry value expression from an entry DBG_VALUE,
+    /// and make a copy location of the debug entry value by seting the register
+    /// to the NewReg.
----------------
//seting -> setting//


================
Comment at: llvm/lib/CodeGen/LiveDebugValues.cpp:750
+  if (MI.getOperand(0).isReg() && MI.getOperand(0).getReg() != EntryValueReg) {
+    LLVM_DEBUG(dbgs() << "Deliting a DBG entry value because of: ";
+               MI.print(dbgs(), /*IsStandalone*/ false,
----------------
//Deliting -> Deleting//


================
Comment at: llvm/lib/CodeGen/LiveDebugValues.cpp:1137
+    for (auto &EnltyValue : DebugEntryVals) {
+      if (EnltyValue.second.DbgEntryValue->getOperand(0).getReg() == SrcReg ||
+          (EnltyValue.second.DbgEntryValueMovement &&
----------------
In order to improve the readability, can you move this into a helper function?


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

https://reviews.llvm.org/D68209





More information about the llvm-commits mailing list