void CGSCCAnalysisManager::invalidateImpl(LazyCallGraph::SCC &C,
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 SCC: " << C.getName()
<< "\n";