[llvm] r335179 - [MemorySSA] Add convenience APIs in updater to avoid needing MSSA.

Alina Sbirlea via llvm-commits llvm-commits at lists.llvm.org
Wed Jun 20 14:30:29 PDT 2018


Author: asbirlea
Date: Wed Jun 20 14:30:29 2018
New Revision: 335179

URL: http://llvm.org/viewvc/llvm-project?rev=335179&view=rev
Log:
[MemorySSA] Add convenience APIs in updater to avoid needing MSSA.

Summary:
Ideally passes should not need to pass MSSA around and do all updates through the updater.
Add convenience APIs to help with that.

Reviewers: george.burgess.iv

Subscribers: sanjoy, jlebar, llvm-commits, Prazek

Differential Revision: https://reviews.llvm.org/D48334

Modified:
    llvm/trunk/include/llvm/Analysis/MemorySSAUpdater.h

Modified: llvm/trunk/include/llvm/Analysis/MemorySSAUpdater.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Analysis/MemorySSAUpdater.h?rev=335179&r1=335178&r2=335179&view=diff
==============================================================================
--- llvm/trunk/include/llvm/Analysis/MemorySSAUpdater.h (original)
+++ llvm/trunk/include/llvm/Analysis/MemorySSAUpdater.h Wed Jun 20 14:30:29 2018
@@ -138,6 +138,17 @@ public:
   /// 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>




More information about the llvm-commits mailing list