[PATCH] D133319: [Assignment Tracking][22/*] Add loop-deletion test

Jeremy Morse via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Sep 13 02:42:06 PDT 2022


jmorse accepted this revision.
jmorse added a comment.
This revision is now accepted and ready to land.

LGTM with nit.

I find the reproducer utterly fascinating -- because of the leak, the variable is partially promoted, and the store in the condition block dominates the leak site so there's no loop-exit-PHI that a dbg.value gets attached to. Instead the last dbg.value is inside the loop, and gets set to undef when the loop is loop-reduced away. LowerDbgDeclare has a partial save by instrumenting the call site, but that's something dbg.assign does better.

Will this stop working if the fix to `TryToSimplifyUncondBranchFromEmptyBlock` in D133310 <https://reviews.llvm.org/D133310> doesn't land?



================
Comment at: llvm/test/DebugInfo/Generic/assignment-tracking/loop-deletion/dead-loop.ll:21
+; CHECK: for.end:
+; CHECK-NEXT: call void @llvm.dbg.assign
+
----------------
I'd suggest more detail in what the operands to dbg.assign are, just to confirm it isn't stripped of all information. Ensuring it still refers to the alloca would be good.


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

https://reviews.llvm.org/D133319



More information about the llvm-commits mailing list