[PATCH] D48334: [MemorySSA] Add convenience APIs in updater to avoid needing MSSA.

Alina Sbirlea via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jun 20 13:57:51 PDT 2018


asbirlea updated this revision to Diff 152153.
asbirlea added a comment.

Address comments.


Repository:
  rL LLVM

https://reviews.llvm.org/D48334

Files:
  include/llvm/Analysis/MemorySSAUpdater.h


Index: include/llvm/Analysis/MemorySSAUpdater.h
===================================================================
--- include/llvm/Analysis/MemorySSAUpdater.h
+++ include/llvm/Analysis/MemorySSAUpdater.h
@@ -138,6 +138,17 @@
   /// on the MemoryAccess for that store/load.
   void removeMemoryAccess(MemoryAccess *);
 
+  /// Remove MemoryAccess for a given instruction, if a MemoryAccess exists.
+  /// This should be called when an instruction (load/store) is deleted from
+  /// the program.
+  void removeMemoryAccess(const Instruction *I) {
+    if (MemoryAccess *MA = MSSA->getMemoryAccess(I))
+      removeMemoryAccess(MA);
+  }
+
+  /// Get handle on MemorySSA.
+  MemorySSA* getMemorySSA() const { return MSSA; }
+
 private:
   // Move What before Where in the MemorySSA IR.
   template <class WhereType>


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D48334.152153.patch
Type: text/x-patch
Size: 816 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180620/b2489b01/attachment.bin>


More information about the llvm-commits mailing list