[llvm-commits] CVS: llvm/include/llvm/Pass.h PassManagers.h
Devang Patel
dpatel at apple.com
Mon Mar 5 17:56:07 PST 2007
Changes in directory llvm/include/llvm:
Pass.h updated: 1.80 -> 1.81
PassManagers.h updated: 1.12 -> 1.13
---
Log message:
Keep track of inherited analysis. For example, if a loop pass does not
preserve dominator info then it should update parent FPPassManager's
available analysis info to reflect this.
---
Diffs of the changes: (+23 -1)
Pass.h | 3 ++-
PassManagers.h | 21 +++++++++++++++++++++
2 files changed, 23 insertions(+), 1 deletion(-)
Index: llvm/include/llvm/Pass.h
diff -u llvm/include/llvm/Pass.h:1.80 llvm/include/llvm/Pass.h:1.81
--- llvm/include/llvm/Pass.h:1.80 Mon Mar 5 19:06:16 2007
+++ llvm/include/llvm/Pass.h Mon Mar 5 19:55:46 2007
@@ -64,7 +64,8 @@
PMT_CallGraphPassManager, /// CGPassManager
PMT_FunctionPassManager, /// FPPassManager
PMT_LoopPassManager, /// LPPassManager
- PMT_BasicBlockPassManager /// BBPassManager
+ PMT_BasicBlockPassManager, /// BBPassManager
+ PMT_Last
};
typedef enum PassManagerType PassManagerType;
Index: llvm/include/llvm/PassManagers.h
diff -u llvm/include/llvm/PassManagers.h:1.12 llvm/include/llvm/PassManagers.h:1.13
--- llvm/include/llvm/PassManagers.h:1.12 Mon Mar 5 16:57:49 2007
+++ llvm/include/llvm/PassManagers.h Mon Mar 5 19:55:46 2007
@@ -197,6 +197,7 @@
/// used by pass managers.
class PMDataManager {
public:
+
PMDataManager(int Depth) : TPM(NULL), Depth(Depth) {
initializeAnalysisInfo();
}
@@ -223,6 +224,8 @@
/// Initialize available analysis information.
void initializeAnalysisInfo() {
AvailableAnalysis.clear();
+ for (unsigned i = 0; i < PMT_Last; ++i)
+ InheritedAnalysis[i] = NULL;
}
/// Populate RequiredPasses with the analysis pass that are required by
@@ -262,6 +265,19 @@
assert ( 0 && "Invalid use of getPassManagerType");
return PMT_Unknown;
}
+
+ std::map<AnalysisID, Pass*> *getAvailableAnalysis() {
+ return &AvailableAnalysis;
+ }
+
+ // Collect AvailableAnalysis from all the active Pass Managers.
+ void populateInheritedAnalysis(PMStack &PMS) {
+ unsigned Index = 0;
+ for (PMStack::iterator I = PMS.begin(), E = PMS.end();
+ I != E; ++I)
+ InheritedAnalysis[Index++] = (*I)->getAvailableAnalysis();
+ }
+
protected:
// Top level manager.
@@ -270,6 +286,11 @@
// Collection of pass that are managed by this manager
std::vector<Pass *> PassVector;
+ // Collection of Analysis provided by Parent pass manager and
+ // used by current pass manager. At at time there can not be more
+ // then PMT_Last active pass mangers.
+ std::map<AnalysisID, Pass *> *InheritedAnalysis[PMT_Last];
+
private:
// Set of available Analysis. This information is used while scheduling
// pass. If a pass requires an analysis which is not not available then
More information about the llvm-commits
mailing list