[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
Tue Jun 19 13:50:53 PDT 2018
asbirlea created this revision.
asbirlea added a reviewer: george.burgess.iv.
Herald added subscribers: Prazek, jlebar, sanjoy.
Ideally passes should not need to pass MSSA around and do all updates through the updater.
Add convenience APIs to help with that.
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 MemorySSAUpdater::removeMemoryAccess(Instruction *I) {
+ if (MemoryAccess *MA = MSSA->getMemoryAccess(I))
+ removeMemoryAccess(MA);
+ }
+
+ /// Verify MemorySSA correctness after an update
+ void verifyMemorySSA() { MSSA->verifyMemorySSA(); }
+
private:
// Move What before Where in the MemorySSA IR.
template <class WhereType>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D48334.151972.patch
Type: text/x-patch
Size: 851 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180619/8316109b/attachment.bin>
More information about the llvm-commits
mailing list