summaryrefslogtreecommitdiff
path: root/include
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 /include
parent50192c215252cf20e0b205ee2012272aa9b9b1a2 (diff)
downloadllvm-c7e49c08c22658dd16a5cac1500b0b70047bedc4.tar.gz
llvm-c7e49c08c22658dd16a5cac1500b0b70047bedc4.tar.bz2
llvm-c7e49c08c22658dd16a5cac1500b0b70047bedc4.tar.xz
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 'include')
-rw-r--r--include/llvm/Analysis/LoopPass.h29
1 files changed, 29 insertions, 0 deletions
diff --git a/include/llvm/Analysis/LoopPass.h b/include/llvm/Analysis/LoopPass.h
index 33135156ad..4914df78e4 100644
--- a/include/llvm/Analysis/LoopPass.h
+++ b/include/llvm/Analysis/LoopPass.h
@@ -63,6 +63,21 @@ class LoopPass : public Pass {
virtual PassManagerType getPotentialPassManagerType() const {
return PMT_LoopPassManager;
}
+
+ //===--------------------------------------------------------------------===//
+ /// SimpleAnalysis - Provides simple interface to update analysis info
+ /// maintained by various passes. Note, if required this interface can
+ /// be extracted into a separate abstract class but it would require
+ /// additional use of multiple inheritance in Pass class hierarcy, someting
+ /// we are trying to avoid.
+
+ /// Each loop pass can override these simple analysis hookss to update
+ /// desired analysis information.
+ /// cloneBasicBlockAnalysis - Clone analysis info associated with basic block.
+ virtual void cloneBasicBlockAnalysis(BasicBlock *F, BasicBlock *T, Loop *L) {}
+
+ /// deletekAnalysisValue - Delete analysis info associated with value V.
+ virtual void deleteAnalysisValue(Value *V, Loop *L) {}
};
class LPPassManager : public FunctionPass, public PMDataManager {
@@ -115,6 +130,20 @@ public:
// utility may send LPPassManager into infinite loops so use caution.
void redoLoop(Loop *L);
+ //===--------------------------------------------------------------------===//
+ /// SimpleAnalysis - Provides simple interface to update analysis info
+ /// maintained by various passes. Note, if required this interface can
+ /// be extracted into a separate abstract class but it would require
+ /// additional use of multiple inheritance in Pass class hierarcy, someting
+ /// we are trying to avoid.
+
+ /// cloneBasicBlockSimpleAnalysis - Invoke cloneBasicBlockAnalysis hook for
+ /// all passes that implement simple analysis interface.
+ void cloneBasicBlockSimpleAnalysis(BasicBlock *From, BasicBlock *To, Loop *L);
+
+ /// deleteSimpleAnalysisValue - Invoke deleteAnalysisValue hook for all passes
+ /// that implement simple analysis interface.
+ void deleteSimpleAnalysisValue(Value *V, Loop *L);
private:
std::deque<Loop *> LQ;
bool skipThisLoop;