[PATCH] D133294: [Assignment Tracking][11/*] Update RemoveRedundantDbgInstrs

Orlando Cazalet-Hyams via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Sep 5 05:14:55 PDT 2022


Orlando created this revision.
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.

Update the `RemoveRedundantDbgInstrs` utility to avoid sometimes losing information when deleting dbg.assign intrinsics.

`removeRedundantDbgInstrsUsingBackwardScan` - treat dbg.assign intrinsics that are not linked to any instruction just like dbg.values. That is, in a block of contiguous debug intrinsics, delete all other than the last definition for a fragment. Leave linked dbg.assign intrinsics in place.

`removeRedundantDbgInstrsUsingForwardScan` - this function has two changes. First, undef and unlinked dbg.assign intrinsics encountered in the entry block before any non-undef non-unlinked intrinsics for a given fragment are deleted. Second, don't delete linked dbg.assign intrinsics and don't the next intrinsic found even if it would otherwise be eligible for deletion.


https://reviews.llvm.org/D133294

Files:
  llvm/lib/Transforms/Utils/BasicBlockUtils.cpp
  llvm/test/DebugInfo/Generic/assignment-tracking/remove-redundant.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D133294.457910.patch
Type: text/x-patch
Size: 10876 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220905/894a60bd/attachment.bin>


More information about the llvm-commits mailing list