mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-01-06 04:31:08 +00:00
Keep track of higher level analysis.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34974 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
f429e82c98
commit
7b65dd91c1
@ -228,6 +228,11 @@ public:
|
||||
InheritedAnalysis[i] = NULL;
|
||||
}
|
||||
|
||||
// Return true if P preserves high level analysis used by other
|
||||
// passes that are managed by this manager.
|
||||
bool preserveHigherLevelAnalysis(Pass *P);
|
||||
|
||||
|
||||
/// Populate RequiredPasses with the analysis pass that are required by
|
||||
/// pass P.
|
||||
void collectRequiredAnalysisPasses(std::vector<Pass *> &RequiredPasses,
|
||||
@ -298,6 +303,10 @@ private:
|
||||
// scheduled to run.
|
||||
std::map<AnalysisID, Pass*> AvailableAnalysis;
|
||||
|
||||
// Collection of higher level analysis used by the pass managed by
|
||||
// this manager.
|
||||
std::vector<Pass *> HigherLevelAnalysis;
|
||||
|
||||
unsigned Depth;
|
||||
};
|
||||
|
||||
|
@ -532,6 +532,30 @@ void PMDataManager::recordAvailableAnalysis(Pass *P) {
|
||||
}
|
||||
}
|
||||
|
||||
// Return true if P preserves high level analysis used by other
|
||||
// passes managed by this manager
|
||||
bool PMDataManager::preserveHigherLevelAnalysis(Pass *P) {
|
||||
|
||||
AnalysisUsage AnUsage;
|
||||
P->getAnalysisUsage(AnUsage);
|
||||
|
||||
if (AnUsage.getPreservesAll())
|
||||
return true;
|
||||
|
||||
const std::vector<AnalysisID> &PreservedSet = AnUsage.getPreservedSet();
|
||||
for (std::vector<Pass *>::iterator I = HigherLevelAnalysis.begin(),
|
||||
E = HigherLevelAnalysis.end(); I != E; ++I) {
|
||||
Pass *P1 = *I;
|
||||
if (std::find(PreservedSet.begin(), PreservedSet.end(), P1->getPassInfo()) ==
|
||||
PreservedSet.end()) {
|
||||
if (!dynamic_cast<ImmutablePass*>(P1))
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/// Remove Analyss not preserved by Pass P
|
||||
void PMDataManager::removeNotPreservedAnalysis(Pass *P) {
|
||||
AnalysisUsage AnUsage;
|
||||
@ -634,6 +658,8 @@ void PMDataManager::add(Pass *P,
|
||||
else if (PDepth > RDepth) {
|
||||
// Let the parent claim responsibility of last use
|
||||
TransferLastUses.push_back(PRequired);
|
||||
// Keep track of higher level analysis used by this manager.
|
||||
HigherLevelAnalysis.push_back(PRequired);
|
||||
} else {
|
||||
// Note : This feature is not yet implemented
|
||||
assert (0 &&
|
||||
|
Loading…
Reference in New Issue
Block a user