[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

llvm-svn: 335179
This commit is contained in:
Alina Sbirlea 2018-06-20 21:30:29 +00:00
parent 1958497283
commit 04ff58220f
1 changed files with 11 additions and 0 deletions

View File

@ -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>