[PATCH] D55396: [DebugInfo] Make sure CodeGenPrepare does not drop MD references to locals.

Wolfgang Pieb via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Dec 6 17:53:10 PST 2018


wolfgangp marked 2 inline comments as done.
wolfgangp added inline comments.


================
Comment at: lib/CodeGen/CodeGenPrepare.cpp:2382
+      // If the instruction is used by Metadata, RAUW will also replace the
+      // MD uses. To undo these replacements, we perform the reverse RAUW,
+      // provided that the replacement value does not have any MD uses itself
----------------
aprantl wrote:
> Can you also add a sentence about why we would want to undo those replacements?
The "why" is directly mandated by the transaction-style design of the optimizations in CGP. Perhaps I'll rephrase the second sentence.


================
Comment at: lib/CodeGen/CodeGenPrepare.cpp:2390
+      // them from the undo.
+      if (Inst->isUsedByMetadata() && !New->isUsedByMetadata())
+        Replacement = New;
----------------
vsk wrote:
> Is it really uncommon for both Inst and New to be used by metadata? If not, it might be nice to tackle this fixme. Some modified version of findDbgUsers should help do the job.
Let me try and collect some statistics on this. In any case, my concern was not so much finding the nodes as doing the replacement, as this seems a bit involved, but looking at findDbgUses() helps. Thanks.


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

https://reviews.llvm.org/D55396





More information about the llvm-commits mailing list