[PATCH] D60833: [MemorySSA] Teach LoopSimplify to preserve MemorySSA.

George Burgess IV via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed May 1 15:29:37 PDT 2019


george.burgess.iv added a comment.

MSSA bits LGTM modulo a few nits. Feel free to commit when Chandler is happy.

Thanks again!



================
Comment at: lib/Analysis/MemorySSAUpdater.cpp:1258
 
+void MemorySSAUpdater::tryRemoveTrivialPhis(SmallVectorImpl<WeakVH> &UpdatedPHIs,
+                                            unsigned Start, unsigned Stop) {
----------------
nit: Would it work just as well to take an `ArrayRef<WeakVH>` here and drop `Start`/`Stop` params? (That way, we can also simplify the loop to a `for` over `UpdatedPHIs`)

If not, please make UpdatedPhis a const&


================
Comment at: lib/Analysis/MemorySSAUpdater.cpp:1262
+    if (auto *MPhi = cast_or_null<MemoryPhi>(UpdatedPHIs[Idx])) {
+        auto OperRange = MPhi->operands();
+        tryRemoveTrivialPhi(MPhi, OperRange);
----------------
Please clang-format


================
Comment at: lib/Analysis/MemorySSAUpdater.cpp:1290
+                                                         BasicBlock *To) {
+  auto *BB = BI->getParent();
+  SmallVector<WeakVH, 16> UpdatedPHIs;
----------------
nit: s/auto */(const )?BasicBlock */ for consistency with elsewhere, please


Repository:
  rL LLVM

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

https://reviews.llvm.org/D60833





More information about the llvm-commits mailing list