[Assignment Tracking][12/*] Account for assignment tracking in mem2reg
authorOCHyams <orlando.hyams@sony.com>
Tue, 15 Nov 2022 10:52:45 +0000 (10:52 +0000)
committerOCHyams <orlando.hyams@sony.com>
Tue, 15 Nov 2022 11:11:57 +0000 (11:11 +0000)
commit0946e463e8649896654b0dd39193db76a5789e11
tree623ae46fd11fb5d3d9627afd986d4d87e0ffaa3f
parent896271dbea18be695c2322321c1112999b4ada4f
[Assignment Tracking][12/*] Account for assignment tracking in mem2reg

The Assignment Tracking debug-info feature is outlined in this RFC:

https://discourse.llvm.org/t/
rfc-assignment-tracking-a-better-way-of-specifying-variable-locations-in-ir

The changes for assignment tracking in mem2reg don't require much of a
deviation from existing behaviour. dbg.assign intrinsics linked to an alloca
are treated much in the same way as dbg.declare users of an alloca, except that
we don't insert dbg.value intrinsics to describe assignments when there is
already a dbg.assign intrinsic present, e.g. one linked to a store that is
going to be removed.

Reviewed By: jmorse

Differential Revision: https://reviews.llvm.org/D133295
llvm/lib/Transforms/Utils/Local.cpp
llvm/lib/Transforms/Utils/PromoteMemoryToRegister.cpp
llvm/test/DebugInfo/Generic/assignment-tracking/mem2reg/phi.ll [new file with mode: 0644]
llvm/test/DebugInfo/Generic/assignment-tracking/mem2reg/single-block-alloca.ll [new file with mode: 0644]
llvm/test/DebugInfo/Generic/assignment-tracking/mem2reg/single-store-alloca.ll [new file with mode: 0644]