[PATCH] D57199: [MemorySSA] Extend removeMemoryAccess API to optimize MemoryPhis.

George Burgess IV via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jan 30 13:00:09 PST 2019


george.burgess.iv accepted this revision.
george.burgess.iv added a comment.
This revision is now accepted and ready to land.

LGTM after one nit is addressed.

If I'm just imagining that my nit is possible, I'm happy to have this patch submitted as-is.

Thanks again!



================
Comment at: lib/Analysis/MemorySSAUpdater.cpp:1108
+  if (!PhisToCheck.empty()) {
+    SmallVector<TrackingVH<MemoryPhi>, 16> PhisToOptimize;
+    for (MemoryPhi *MP : PhisToCheck)
----------------
...But it can remove more than a single MemoryPhi, no? It'll traverse the users of the MemoryPhis we know we can remove (e.g. `onlySingleValue` ones); there may be many of these.

In any case, both approaches are functionally equivalent in my mind, and I have no preference either way, so this approach LGTM.

Nit: can we simplify to `PhisToOptimize{PhisToCheck.begin(), PhisToCheck.end()};` and skip the loop below?


Repository:
  rL LLVM

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

https://reviews.llvm.org/D57199





More information about the llvm-commits mailing list