aboutsummaryrefslogtreecommitdiff
path: root/lib/Analysis/LoopPass.cpp
diff options
context:
space:
mode:
authorDevang Patel <dpatel@apple.com>2007-07-31 08:00:57 +0000
committerDevang Patel <dpatel@apple.com>2007-07-31 08:00:57 +0000
commitc7e49c08c22658dd16a5cac1500b0b70047bedc4 (patch)
tree96edf6363595ddebe03b778fb51816b6597ea52c /lib/Analysis/LoopPass.cpp
parent50192c215252cf20e0b205ee2012272aa9b9b1a2 (diff)
Introduce Simple Analysis interface for loop passes.
Right now, this interface provides hooks for only to operations, 1) clone basic block 2) delete value. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40625 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Analysis/LoopPass.cpp')
-rw-r--r--lib/Analysis/LoopPass.cpp21
1 files changed, 21 insertions, 0 deletions
diff --git a/lib/Analysis/LoopPass.cpp b/lib/Analysis/LoopPass.cpp
index dc3e86844e..21c14c6293 100644
--- a/lib/Analysis/LoopPass.cpp
+++ b/lib/Analysis/LoopPass.cpp
@@ -140,6 +140,27 @@ void LPPassManager::redoLoop(Loop *L) {
redoThisLoop = true;
}
+/// cloneBasicBlockSimpleAnalysis - Invoke cloneBasicBlockAnalysis hook for
+/// all loop passes.
+void LPPassManager::cloneBasicBlockSimpleAnalysis(BasicBlock *From,
+ BasicBlock *To, Loop *L) {
+ for (unsigned Index = 0; Index < getNumContainedPasses(); ++Index) {
+ Pass *P = getContainedPass(Index);
+ LoopPass *LP = dynamic_cast<LoopPass *>(P);
+ LP->cloneBasicBlockAnalysis(From, To, L);
+ }
+}
+
+/// deleteSimpleAnalysisValue - Invoke deleteAnalysisValue hook for all passes.
+void LPPassManager::deleteSimpleAnalysisValue(Value *V, Loop *L) {
+ for (unsigned Index = 0; Index < getNumContainedPasses(); ++Index) {
+ Pass *P = getContainedPass(Index);
+ LoopPass *LP = dynamic_cast<LoopPass *>(P);
+ LP->deleteAnalysisValue(V, L);
+ }
+}
+
+
// Recurse through all subloops and all loops into LQ.
static void addLoopIntoQueue(Loop *L, std::deque<Loop *> &LQ) {
LQ.push_back(L);