[PATCH] D133295: [Assignment Tracking][12/*] Account for assignment tracking in mem2reg

Orlando Cazalet-Hyams via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Sep 8 00:20:54 PDT 2022


Orlando added a comment.

In D133295#3774554 <https://reviews.llvm.org/D133295#3774554>, @jmorse wrote:

> Possibly I've missed something -- there's nothing here that's converting dbg.declares to dbg.assigns, so it's up to the frontend to produce appropriate dbg.assigns initially, yes?

Yep, in D132226 <https://reviews.llvm.org/D132226> Clang injects the pass `AssignmentTrackingPass`,  which added in D132225 <https://reviews.llvm.org/D132225>, into the optimization pipeline. It runs before any optimizations.

N.B. (possibly going off on a tangent here): originally, in the prototype, the initial dbg.assign-inserting was done from the front end, but the implementation basically had the same behaviour as that pass (convert dbg.declares to dbg.assigns). Using a pass has advantages in that it can be tested, and it's less invasive in Clang, and provides a cheap/easy way for front ends to try out assignment tracking. In the long run we should probably aim to deprecate the pass (and dbg.declare) and get front ends to produce the intrinsics themselves, but I think this is a good staging step.


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

https://reviews.llvm.org/D133295



More information about the llvm-commits mailing list