diff options
Diffstat (limited to 'llvm/lib/IR/PassManager.cpp')
-rw-r--r-- | llvm/lib/IR/PassManager.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/llvm/lib/IR/PassManager.cpp b/llvm/lib/IR/PassManager.cpp index c7638bb7fce..1eab4ae19bf 100644 --- a/llvm/lib/IR/PassManager.cpp +++ b/llvm/lib/IR/PassManager.cpp @@ -78,6 +78,10 @@ void ModuleAnalysisManager::invalidateImpl(void *PassID, Module &M) { void ModuleAnalysisManager::invalidateImpl(Module &M, const PreservedAnalyses &PA) { + // Short circuit for a common case of all analyses being preserved. + if (PA.areAllPreserved()) + return; + if (DebugPM) dbgs() << "Invalidating all non-preserved analyses for module: " << M.getModuleIdentifier() << "\n"; @@ -176,6 +180,10 @@ void FunctionAnalysisManager::invalidateImpl(void *PassID, Function &F) { void FunctionAnalysisManager::invalidateImpl(Function &F, const PreservedAnalyses &PA) { + // Short circuit for a common case of all analyses being preserved. + if (PA.areAllPreserved()) + return; + if (DebugPM) dbgs() << "Invalidating all non-preserved analyses for function: " << F.getName() << "\n"; |