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