aboutsummaryrefslogtreecommitdiffstats
path: root/include/llvm/PassManagers.h
diff options
context:
space:
mode:
authorDevang Patel <dpatel@apple.com>2007-03-06 01:55:46 +0000
committerDevang Patel <dpatel@apple.com>2007-03-06 01:55:46 +0000
commitfe613905b371ef7160968cdaabf6074cfa10f4a0 (patch)
tree117eaa2b5e108e62103852008654c9d168be6242 /include/llvm/PassManagers.h
parent22a1cf9d3a5c829d260bcf44ffe6b34ecf16076c (diff)
downloadexternal_llvm-fe613905b371ef7160968cdaabf6074cfa10f4a0.zip
external_llvm-fe613905b371ef7160968cdaabf6074cfa10f4a0.tar.gz
external_llvm-fe613905b371ef7160968cdaabf6074cfa10f4a0.tar.bz2
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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34942 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/PassManagers.h')
-rw-r--r--include/llvm/PassManagers.h21
1 files changed, 21 insertions, 0 deletions
diff --git a/include/llvm/PassManagers.h b/include/llvm/PassManagers.h
index b2a0a9f..0bc2def 100644
--- a/include/llvm/PassManagers.h
+++ b/include/llvm/PassManagers.h
@@ -197,6 +197,7 @@ private:
/// used by pass managers.
class PMDataManager {
public:
+
PMDataManager(int Depth) : TPM(NULL), Depth(Depth) {
initializeAnalysisInfo();
}
@@ -223,6 +224,8 @@ public:
/// 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 @@ public:
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 @@ protected:
// 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