[PATCH] D99169: [DebugInfo] Replace debug uses in replaceUsesOutsideBlock

Djordje Todorovic via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Apr 6 06:37:22 PDT 2021


djtodoro added inline comments.


================
Comment at: llvm/lib/IR/Value.cpp:547-553
+  // Replace dbg.* uses of MetadataAsValue(ValueAsMetadata(this)) outside BB.
+  SmallVector<DbgVariableIntrinsic *> DbgUsers;
+  findDbgUsers(DbgUsers, this);
+  for (auto *DVI : DbgUsers) {
+    if (DVI->getParent() != BB)
+      DVI->replaceVariableLocationOp(this, New);
+  }
----------------
Orlando wrote:
> djtodoro wrote:
> > Can we factor out this into a separate predicate?
> Just to check I understand - your suggestion is to change `replaceUsesWithIf` to accept a new additional predicate which handles these debug uses?
I vote either for extending the `replaceUsesWithIf()` or creating a separate static function that has this code.


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

https://reviews.llvm.org/D99169



More information about the llvm-commits mailing list