[PATCH] D148536: [Assignment Tracking] Fix fragment error for some DSE-shortened stores
Orlando Cazalet-Hyams via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Mon Apr 17 09:01:15 PDT 2023
Orlando created this revision.
Orlando added reviewers: jmorse, paulkirth.
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.
`shortenAssignment` inserts dbg.assigns with fragments describing the dead part of a shortened store after each dbg.assign linked to the store.
Without this patch it doesn't take into account that the dead part of a shortened store may be outside the bounds of a variable of a linked dbg.assign. It also doesn't correctly account for a non-zero offset in the address modifying `DIExpression` of the dbg.assign (which is possible for fragments now even though whole variables currently cannot have a non-zero offset in their alloca).
Fix this by moving the dead slice into variable-space and performing an intersect of that adjusted slice with the existing fragment.
This fixes a verifier error reported when building chromium with assignment tracking enabled: https://ci.chromium.org/ui/p/fuchsia/builders/ci/clang_toolchain.ci.core.x64-release/b8784000953022145169/overview
https://reviews.llvm.org/D148536
Files:
llvm/lib/Transforms/Scalar/DeadStoreElimination.cpp
llvm/test/DebugInfo/Generic/assignment-tracking/dse/dse-after-memcpyopt-merge.ll
llvm/test/DebugInfo/Generic/assignment-tracking/dse/shorten-offset.ll
llvm/test/DebugInfo/Generic/assignment-tracking/dse/shorten.ll
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D148536.514261.patch
Type: text/x-patch
Size: 26164 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230417/b46d97dc/attachment.bin>
More information about the llvm-commits
mailing list