summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Analysis/LoopPassManager.cpp
diff options
context:
space:
mode:
authorJustin Bogner <mail@justinbogner.com>2016-05-03 21:35:08 +0000
committerJustin Bogner <mail@justinbogner.com>2016-05-03 21:35:08 +0000
commite839c3e6ab376b7b2024b2323b5c52f61af00581 (patch)
tree7d1876f21d5eb42765bfdb46378254ba6749fd87 /llvm/lib/Analysis/LoopPassManager.cpp
parent27cb2f12252776825f656997ec4ee8f552259f08 (diff)
downloadbcm5719-llvm-e839c3e6ab376b7b2024b2323b5c52f61af00581.tar.gz
bcm5719-llvm-e839c3e6ab376b7b2024b2323b5c52f61af00581.zip
PM: Check that loop passes preserve a basic set of analyses
A loop pass that didn't preserve this entire set of passes wouldn't play well with other loop passes, since these are generally a basic requirement to do any interesting transformations to a loop. Adds a helper to get the set of analyses a loop pass should preserve, and checks that any loop pass we run satisfies the requirement. llvm-svn: 268444
Diffstat (limited to 'llvm/lib/Analysis/LoopPassManager.cpp')
-rw-r--r--llvm/lib/Analysis/LoopPassManager.cpp19
1 files changed, 19 insertions, 0 deletions
diff --git a/llvm/lib/Analysis/LoopPassManager.cpp b/llvm/lib/Analysis/LoopPassManager.cpp
index 76210fa89c0..8bac19a5821 100644
--- a/llvm/lib/Analysis/LoopPassManager.cpp
+++ b/llvm/lib/Analysis/LoopPassManager.cpp
@@ -8,6 +8,12 @@
//===----------------------------------------------------------------------===//
#include "llvm/Analysis/LoopPassManager.h"
+#include "llvm/Analysis/BasicAliasAnalysis.h"
+#include "llvm/Analysis/GlobalsModRef.h"
+#include "llvm/Analysis/LoopInfo.h"
+#include "llvm/Analysis/ScalarEvolution.h"
+#include "llvm/Analysis/ScalarEvolutionAliasAnalysis.h"
+#include "llvm/IR/Dominators.h"
using namespace llvm;
@@ -18,3 +24,16 @@ template class AnalysisManager<Loop>;
template class InnerAnalysisManagerProxy<LoopAnalysisManager, Function>;
template class OuterAnalysisManagerProxy<FunctionAnalysisManager, Loop>;
}
+
+PreservedAnalyses llvm::getLoopPassPreservedAnalyses() {
+ PreservedAnalyses PA;
+ PA.preserve<DominatorTreeAnalysis>();
+ PA.preserve<LoopAnalysis>();
+ PA.preserve<ScalarEvolutionAnalysis>();
+ // TODO: What we really want to do here is preserve an AA category, but that
+ // concept doesn't exist yet.
+ PA.preserve<BasicAA>();
+ PA.preserve<GlobalsAA>();
+ PA.preserve<SCEVAA>();
+ return PA;
+}
OpenPOWER on IntegriCloud