[PATCH] D146299: [Assignment Tracking] Fix mem2reg misidentifying unlinked stores

Orlando Cazalet-Hyams via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Mar 17 08:10:12 PDT 2023


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

`updateForDeletedStore` updates the assignment tracking debug info for a store that is about to be deleted by mem2reg. For each variable backed by the target alloca, if a dbg.assign exists it is kept (well - it's downgraded to a dbg.value). If there's not a linked dbg.assign for a variable which is  backed by the target alloca a dbg.value is inserted now. This patch fixes a bug whereby a store with a linked dbg.assign that describes a fragment different to the one linked to the alloca was not counted for the variable, leading to both keeping the dbg.assign (downgrading it) and inserting a new one.


https://reviews.llvm.org/D146299

Files:
  llvm/lib/Transforms/Utils/PromoteMemoryToRegister.cpp
  llvm/test/DebugInfo/Generic/assignment-tracking/mem2reg/store-to-part-of-alloca.ll
  llvm/test/DebugInfo/Generic/assignment-tracking/sroa/vec-2.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D146299.506085.patch
Type: text/x-patch
Size: 6007 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230317/ade57ef3/attachment.bin>


More information about the llvm-commits mailing list