[PATCH] D145511: [Assignment Tracking] Downgrade dbg.assigns to dbg.values in mem2reg

Orlando Cazalet-Hyams via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Mar 7 08:28:58 PST 2023


Orlando created this revision.
Orlando added reviewers: scott.linder, jmorse, StephenTozer.
Orlando added a project: debug-info.
Herald added a subscriber: hiraditya.
Herald added a project: All.
Orlando requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

For fully promoted variables dbg.assigns and dbg.values convey the same information and can be used interchangeably. This patch converts dbg.assigns to dbg.values for variables promoted by mem2reg. This reduces resource usage by reducing the amount of unnecessary function local metadata. The compile time tracker reports that CTMark projects build with LTO-O3-g with 0.4% fewer instructions retired and peak memory usage is reduced by 2.2%.

I would like to explore making "value-only" dbg.assigns cheaper in the future but this is a worthwhile improvement for the time being IMO.


https://reviews.llvm.org/D145511

Files:
  llvm/lib/Transforms/Utils/PromoteMemoryToRegister.cpp
  llvm/test/DebugInfo/Generic/assignment-tracking/mem2reg/phi.ll
  llvm/test/DebugInfo/Generic/assignment-tracking/mem2reg/single-block-alloca.ll
  llvm/test/DebugInfo/Generic/assignment-tracking/mem2reg/single-store-alloca.ll
  llvm/test/DebugInfo/Generic/assignment-tracking/sroa/complex.ll
  llvm/test/DebugInfo/Generic/assignment-tracking/sroa/frag.ll
  llvm/test/DebugInfo/Generic/assignment-tracking/sroa/id.ll
  llvm/test/DebugInfo/Generic/assignment-tracking/sroa/memcpy.ll
  llvm/test/DebugInfo/Generic/assignment-tracking/sroa/memmove-to-from-same-alloca.ll
  llvm/test/DebugInfo/Generic/assignment-tracking/sroa/rewrite.ll
  llvm/test/DebugInfo/Generic/assignment-tracking/sroa/store.ll
  llvm/test/DebugInfo/Generic/assignment-tracking/sroa/unspecified-var-size.ll
  llvm/test/DebugInfo/Generic/assignment-tracking/sroa/user-memcpy.ll
  llvm/test/DebugInfo/Generic/assignment-tracking/sroa/vec-1.ll
  llvm/test/DebugInfo/Generic/assignment-tracking/sroa/vec-2.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D145511.503057.patch
Type: text/x-patch
Size: 27206 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230307/4b3afd62/attachment.bin>


More information about the llvm-commits mailing list