[PATCH] D53657: [DEBUG_INFO][NVPTX]Fix processing of DBG_VALUES.

Artem Belevich via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Oct 24 10:21:32 PDT 2018


tra added inline comments.


================
Comment at: lib/Target/NVPTX/NVPTXRegisterInfo.cpp:122-129
+  int Offset = MF.getFrameInfo().getObjectOffset(FrameIndex);
 
   // Using I0 as the frame pointer
-  MI.getOperand(FIOperandNum).ChangeToRegister(NVPTX::VRFrame, false);
+  MI.getOperand(FIOperandNum).ChangeToRegister(NVPTX::VRFrame, /*isDef=*/false);
+  // Special processing of dbg_value instructions.
+  if (!MI.isDebugValue())
+    Offset += MI.getOperand(FIOperandNum + 1).getImm();
----------------
I'm not sure I understand this change.  What is in getOperand(FIOperandNum + 1) for DebugValue instructions? Other instructions carry FI-based offset, but your change appears to ignore it and effectively treats it as if it's always zero.

It may be worth adding more details about *why* debug values need to be handled this way.



================
Comment at: lib/Target/NVPTX/NVPTXRegisterInfo.cpp:126
+  MI.getOperand(FIOperandNum).ChangeToRegister(NVPTX::VRFrame, /*isDef=*/false);
+  // Special processing of dbg_value instructions.
+  if (!MI.isDebugValue())
----------------
nit: currently the code below it appears to do special processing of *non*-DebugValue instructions. 


Repository:
  rL LLVM

https://reviews.llvm.org/D53657





More information about the llvm-commits mailing list