[PATCH] D137707: Move "auto-init" instructions to the dominator of their users

serge via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Feb 2 06:03:44 PST 2023


serge-sans-paille marked 15 inline comments as done.
serge-sans-paille added a comment.

@efriedma : any comment / opinion on this now that it's based on MemorySSA?



================
Comment at: llvm/lib/Transforms/Utils/MoveAutoInit.cpp:72-73
+    } else if (auto *M = dyn_cast<MemoryPhi>(MA)) {
+      for (unsigned i = 0, n = M->getNumIncomingValues(); i != n; ++i)
+        WorkList.push_back(M->getIncomingValue(i));
+    }
----------------
nickdesaulniers wrote:
> Are you able to use a range-for here with `MemoryPhi::incoming_values()`?
Unfortunately not, `SmallVector::append` doesn't accept `iterator_range`. I'll implement that.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D137707



More information about the llvm-commits mailing list