[PATCH] D124878: [Bitcode] Include indirect users of BlockAddresses in bitcode

Wende Tan via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed May 4 14:51:05 PDT 2022


twd2 added inline comments.


================
Comment at: llvm/lib/Bitcode/Writer/BitcodeWriter.cpp:3405
     if (BlockAddress *BA = BlockAddress::lookup(&BB)) {
-      for (User *U : BA->users()) {
-        if (auto *I = dyn_cast<Instruction>(U)) {
-          Function *P = I->getParent()->getParent();
-          if (P != &F)
-            BlockAddressUsers.insert(P);
+      std::deque<Value *> BlockAddressUsersQueue;
+      SmallPtrSet<Value *, 16> BlockAddressUsersVisited;
----------------
nickdesaulniers wrote:
> Can we use a SmallVector (push_back, pop_back_val) instead?
Sure, I believe it's better!


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

https://reviews.llvm.org/D124878



More information about the llvm-commits mailing list