[PATCH] D147777: [Assignment Tracking] Fix fragments for assignments to variables smaller than the alloca

Orlando Cazalet-Hyams via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Apr 7 02:59:42 PDT 2023


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

Prior to this patch the trackAssignments function would attribute all stores to an alloca to all variables linked to the alloca. This is wrong in the case where the alloca contains variables which are smaller than the alloca, and caused erroneous fragment information to be generated.

Now stores outside the variable bounds are discarded, and we check whether a fragment is needed based on whether the store covers the entire variable as opposed to whether it covers the entire alloca (except for variables of unknown size).

Note that trackAssignments doesn't yet understand whole variables sitting at anything other than offset 0 in an alloca - those variables are still tracked using dbg.declares.

Fixes https://lab.llvm.org/buildbot/#/builders/70/builds/36007


https://reviews.llvm.org/D147777

Files:
  llvm/lib/IR/DebugInfo.cpp
  llvm/test/DebugInfo/Generic/assignment-tracking/inline/shared-alloca.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D147777.511649.patch
Type: text/x-patch
Size: 6314 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230407/c396d977/attachment.bin>


More information about the llvm-commits mailing list