Index: include/llvm/Analysis/LoopPass.h =================================================================== --- include/llvm/Analysis/LoopPass.h +++ include/llvm/Analysis/LoopPass.h @@ -87,7 +87,7 @@ /// associated analysis values can be deleted. virtual void deleteAnalysisLoop(Loop *L) {} -protected: +public: /// Optional passes call this function to check whether the pass should be /// skipped. This is the case when Attribute::OptimizeNone is set or when /// optimization bisect is over the limit. Index: lib/Analysis/LoopPass.cpp =================================================================== --- lib/Analysis/LoopPass.cpp +++ lib/Analysis/LoopPass.cpp @@ -205,7 +205,7 @@ : CurrentLoop->getHeader()->getName()); dumpPreservedSet(P); - if (LoopWasDeleted) { + if (LoopWasDeleted || P->skipLoop(CurrentLoop)) { // Notify passes that the loop is being deleted. deleteSimpleAnalysisLoop(CurrentLoop); } else {