[PATCH] D142882: [Assignment Tracking][SROA] Delete dbg.assigns linked to rewritten stores

Orlando Cazalet-Hyams via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jan 31 05:45:14 PST 2023


Orlando added a comment.

In D142882#4093254 <https://reviews.llvm.org/D142882#4093254>, @jmorse wrote:

> LGTM -- and for my understanding, this is because the assignments have been replaced, leaving the dbg.assign hanging around in the case of DSE would be the correct behaviour, yes?
>
> I suppose if that's the case, then there's no scope for automating/refactoring this kind of instrumentation, because replacing/removing have to be separate stages.

Thanks. Yeah - when the store is split the dbg.assigns are cloned and updated (to reflect the split offset/size) - that's done along a code path started by the `emitSplitOps` call just above the added code.

> then there's no scope for automating/refactoring this kind of instrumentation, because replacing/removing have to be separate stages.

It's probably _possible_ - we'd essentially have to keep a mapping of {pre-split allocas/stores: split instructions} and do the splitting at the end - though we'd end up having to change a few things such as not-deleting instructions during the pass (e.g. the code path shown in this diff). Updating as we go along seems to be the path of least resistance (though this implementation isn't perfect -- I have another patching coming soon that fixes some problems with the fragment calculations).


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D142882/new/

https://reviews.llvm.org/D142882



More information about the llvm-commits mailing list