[llvm] [DebugInfo][RemoveDIs] Support cloning and remapping DPValues (PR #72546)

Jeremy Morse via llvm-commits llvm-commits at lists.llvm.org
Thu Nov 23 09:12:50 PST 2023


================
@@ -3327,13 +3340,26 @@ FoldCondBranchOnValueKnownInPredecessorImpl(BranchInst *BI, DomTreeUpdater *DTU,
           TranslateMap[&*BBI] = N;
       }
       if (N) {
+        // Copy all debug-info attached to instructions from the last we
+        // successfully clone, up to this instruction (they might have been
+        // folded away).
+        for (; DbgInfoCursor != BBI; ++DbgInfoCursor)
----------------
jmorse wrote:

It's iterating over the source block where things don't get erased, I think it's only the clones that can be simplified away in the blocks above that get deleted. This is a legitimate confusion though, perhaps renaming it to SrcDbgCursor makes it clearer?

https://github.com/llvm/llvm-project/pull/72546


More information about the llvm-commits mailing list