[PATCH] D81852: [DebugInfo] Update MachineInstr interface to better support variadic DBG_VALUE instructions

Stephen Tozer via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jun 15 09:47:01 PDT 2020


StephenTozer created this revision.
StephenTozer added reviewers: aprantl, probinson, djtodoro, dblaikie.
Herald added subscribers: llvm-commits, tpr, aheejin, hiraditya, jgravelle-google, sbc100, dschuff, qcolombet, MatzeB, jholewinski.
Herald added a project: LLVM.

Following on from this RFC[0] from a while back, this is the first patch towards implementing variadic debug values. The current goal is to add a separate parallel instruction, @llvm.dbg.value.var in IR and DBG_VALUE_VAR in MIR; the reason for doing this is that although this is in many ways a small functional change it will change the operands of the instruction, and the code changes necessary to support it are significant. It may be suitable as a total replacement for the old instruction when finished but there may be justifications for keeping them separate, such as the removal of the offset field or the increased complexity and verbosity of the new instruction. The current design of the instruction is mostly as discussed in the RFC, with no implicit pushing of arguments to the stack, and the exact description will be in the following patch (which adds the instruction).

This patch specifically adds a set of functions to MachineInstr for performing operations specific to debug values, and replacing uses of the more general functions where appropriate. The most prevalent of these is replacing `getOperand(0)` with `getDebugOperand(0)` for debug-value-specific code, as the operands corresponding to values will no longer be at index 0, but index 2 and upwards: `getDebugOperand(x) == getOperand(x+2)`. Similar replacements have been added for the other operands, along with some helper functions to replace oft-repeated code and operate on a variable number of value operands.

This patch should be NFC but I'm in the process of hunting down some issues that have appeared since rebasing my work onto current master; I don't expect any significant changes to result from this.

[0] http://lists.llvm.org/pipermail/llvm-dev/2020-February/139376.html


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D81852

Files:
  llvm/include/llvm/CodeGen/AntiDepBreaker.h
  llvm/include/llvm/CodeGen/MachineInstr.h
  llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
  llvm/lib/CodeGen/AsmPrinter/DbgEntityHistoryCalculator.cpp
  llvm/lib/CodeGen/AsmPrinter/DebugHandlerBase.cpp
  llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
  llvm/lib/CodeGen/LiveDebugValues.cpp
  llvm/lib/CodeGen/LiveDebugVariables.cpp
  llvm/lib/CodeGen/LiveRangeShrink.cpp
  llvm/lib/CodeGen/MachineInstr.cpp
  llvm/lib/CodeGen/MachineRegisterInfo.cpp
  llvm/lib/CodeGen/MachineSink.cpp
  llvm/lib/CodeGen/PrologEpilogInserter.cpp
  llvm/lib/CodeGen/RegAllocFast.cpp
  llvm/lib/CodeGen/RegisterCoalescer.cpp
  llvm/lib/Target/AArch64/AArch64AsmPrinter.cpp
  llvm/lib/Target/NVPTX/NVPTXPrologEpilogPass.cpp
  llvm/lib/Target/SystemZ/SystemZRegisterInfo.cpp
  llvm/lib/Target/WebAssembly/WebAssemblyDebugValueManager.cpp
  llvm/lib/Target/X86/X86OptimizeLEAs.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D81852.270728.patch
Type: text/x-patch
Size: 35702 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200615/3115223e/attachment.bin>


More information about the llvm-commits mailing list