[PATCH] D147696: [Assignment Tracking][SROA] Fix fragment when slice size equals variable size

Orlando Cazalet-Hyams via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Apr 6 03:40:11 PDT 2023


Orlando created this revision.
Orlando added reviewers: StephenTozer, jmorse, scott.linder.
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.

Correctly handle the case of splitting an alloca which backs contiguous distinct variables, where a slice's size equals the size of a backed variable.

We need to ensure that we don't generate fragments expressions with fragments of the same size as the variable as this is a verifier error.

Prior to this patch a fragment expression would be created in this situation. e.g. splitting an alloca i64 with two adjacent 32-bit variables into two 32-bit allocas, the new dbg.assign expressions would contain (DW_OP_LLVM_fragment, 0, 32) and (DW_OP_LLVM_fragment, 32, 32) even though those fragments cover each variable entirely.


https://reviews.llvm.org/D147696

Files:
  llvm/lib/Transforms/Scalar/SROA.cpp
  llvm/test/DebugInfo/Generic/assignment-tracking/sroa/var-sized-fragment.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D147696.511356.patch
Type: text/x-patch
Size: 11207 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230406/26e85d44/attachment.bin>


More information about the llvm-commits mailing list