[PATCH] D45975: [DebugInfo] Invalidate debug info in ReassociatePass::RewriteExprTree

Bjorn Pettersson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Apr 23 11:41:23 PDT 2018


bjope added inline comments.


================
Comment at: lib/Transforms/Scalar/Reassociate.cpp:791
+      for (auto *DII : DbgUsers)
+        DII->setOperand(0, MetadataAsValue::get(DII->getContext(), nullptr));
+
----------------
aprantl wrote:
> I think it would be better use use and undef instead of a nullptr here. Otherwise the intrinsic may will be deleted and doesn't serve as an end point of the live range opened by the previous intrinsic describing the same variable any more.
Not sure if I understand what you mean by "use use and undef instead of nullptr".

I tried to find some place in the code where a dbg.value is invalidated (and not only erased) like this, to find out how to do it. But could not find any pattern to reuse. Do you know if we do this kind of invalidation somewhere already (maybe there is an existing helper similar to salvageDebugInfo that can be used)?




Repository:
  rL LLVM

https://reviews.llvm.org/D45975





More information about the llvm-commits mailing list