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

Vedant Kumar via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Dec 6 16:38:57 PST 2018


vsk added a comment.

Thanks for the patch, this is a great catch.



================
Comment at: lib/CodeGen/CodeGenPrepare.cpp:2365
     SmallVector<InstructionAndIdx, 4> OriginalUses;
+    /// When the instruction is used by Metadata, keep track of the replacement
+    /// value.
----------------
aprantl wrote:
> I find `is used by Metadata` confusing, because then I'm thinking of an actual numbered MDNode. Perhaps say `by a DbgInfoIntrinsic` instead, since this is what we are really interested in?
Seems like "by some ValueAsMetadata" would be more precise, as this isn't limited to debug info.


================
Comment at: lib/CodeGen/CodeGenPrepare.cpp:2390
+      // them from the undo.
+      if (Inst->isUsedByMetadata() && !New->isUsedByMetadata())
+        Replacement = New;
----------------
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.


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

https://reviews.llvm.org/D55396





More information about the llvm-commits mailing list