[PATCH] D91722: [DebugInfo] Use variadic debug values to salvage BinOps and GEP instrs with non-const operands

Stephen Tozer via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Nov 18 08:50:09 PST 2020


StephenTozer created this revision.
StephenTozer added reviewers: probinson, aprantl, djtodoro, vsk, dblaikie.
StephenTozer added a project: debug-info.
Herald added subscribers: llvm-commits, dexonsmith, hiraditya.
Herald added a project: LLVM.
StephenTozer requested review of this revision.

This patch follows the complete implementation of variadic debug values, making use of them to salvage arithmetic operations with two or more non-const operands; this includes the GetElementPtr instruction, and most Binary Operator instructions.

The majority of the real work in this patch is in Local.cpp, where the salvage function has been expanded in complexity for GEP and BinOp instructions, which have thus been refactored out into separate functions. The GEP implementation required the creation of a new function `collectOffset` which behaves similarly to `accumulateConstantOffset`, except that in addition to any constant offset it also fetches any non-constant offsets and returns them in a map of [SSA Value -> Factor].

Outside of these larger changes, the remainder of this patch consists of small utility functions used in salvaging, and updating uses of the salvage functions. Not all places that use salvaging have been updated to make use of variadic salvaging yet (such as salvaging in ISel), as additional changes need to be made in those areas to support this form of salvaging. They should not be difficult to implement in future, however.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D91722

Files:
  llvm/include/llvm/IR/DebugInfoMetadata.h
  llvm/include/llvm/IR/Instructions.h
  llvm/include/llvm/IR/IntrinsicInst.h
  llvm/include/llvm/IR/Operator.h
  llvm/include/llvm/Transforms/Utils/Local.h
  llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
  llvm/lib/IR/DebugInfoMetadata.cpp
  llvm/lib/IR/Instructions.cpp
  llvm/lib/IR/IntrinsicInst.cpp
  llvm/lib/IR/Operator.cpp
  llvm/lib/Transforms/Utils/Local.cpp
  llvm/test/DebugInfo/salvage-gep.ll
  llvm/test/DebugInfo/salvage-nonconst-binop.ll
  llvm/test/Transforms/Reassociate/undef_intrinsics_when_deleting_instructions.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D91722.306110.patch
Type: text/x-patch
Size: 36383 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20201118/a219a5f4/attachment.bin>


More information about the llvm-commits mailing list