Index: llvm/lib/Transforms/Scalar/LoopPassManager.cpp =================================================================== --- llvm/lib/Transforms/Scalar/LoopPassManager.cpp +++ llvm/lib/Transforms/Scalar/LoopPassManager.cpp @@ -285,6 +285,10 @@ else PI.runAfterPass(*Pass, *L, PassPA); + if (LAR.MSSA && !PassPA.getChecker().preserved()) + report_fatal_error("Loop pass manager using MemorySSA contains a pass " + "that does not preserve MemorySSA"); + #ifndef NDEBUG // LoopAnalysisResults should always be valid. // Note that we don't LAR.SE.verify() because that can change observed SE