From ca68a3ec47416185252b84d2bf60710c88be155f Mon Sep 17 00:00:00 2001 From: Chandler Carruth Date: Sun, 15 Jan 2017 06:32:49 +0000 Subject: [PM] Introduce an analysis set used to preserve all analyses over a function's CFG when that CFG is unchanged. This allows transformation passes to simply claim they preserve the CFG and analysis passes to check for the CFG being preserved to remove the fanout of all analyses being listed in all passes. I've gone through and removed or cleaned up as many of the comments reminding us to do this as I could. Differential Revision: https://reviews.llvm.org/D28627 llvm-svn: 292054 --- llvm/lib/IR/Dominators.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'llvm/lib/IR/Dominators.cpp') diff --git a/llvm/lib/IR/Dominators.cpp b/llvm/lib/IR/Dominators.cpp index 1880807da7e..009326825cd 100644 --- a/llvm/lib/IR/Dominators.cpp +++ b/llvm/lib/IR/Dominators.cpp @@ -73,6 +73,15 @@ template void llvm::Calculate>( GraphTraits>::NodeRef>::type> &DT, Function &F); +bool DominatorTree::invalidate(Function &F, const PreservedAnalyses &PA, + FunctionAnalysisManager::Invalidator &) { + // Check whether the analysis, all analyses on functions, or the function's + // CFG have been preserved. + auto PAC = PA.getChecker(); + return !(PAC.preserved() || PAC.preservedSet>() || + PAC.preservedSet()); +} + // dominates - Return true if Def dominates a use in User. This performs // the special checks necessary if Def and User are in the same basic block. // Note that Def doesn't dominate a use in Def itself! -- cgit v1.2.3