mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-01-22 10:33:23 +00:00
RequiredAnalysis support is buggy and not used at the moment so remove
the code. Add TODO note. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32313 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
cbfd29d0da
commit
4045af1175
@ -107,9 +107,6 @@ public:
|
||||
return I->second;
|
||||
}
|
||||
|
||||
/// Augment RequiredAnalysis by adding analysis required by pass P.
|
||||
void noteDownRequiredAnalysis(Pass *P);
|
||||
|
||||
/// Augment AvailableAnalysis by adding analysis made available by pass P.
|
||||
void noteDownAvailableAnalysis(Pass *P);
|
||||
|
||||
@ -119,13 +116,12 @@ public:
|
||||
/// Remove dead passes
|
||||
void removeDeadPasses(Pass *P);
|
||||
|
||||
/// Add pass P into the PassVector. Update RequiredAnalysis and
|
||||
/// Add pass P into the PassVector. Update
|
||||
/// AvailableAnalysis appropriately if ProcessAnalysis is true.
|
||||
void addPassToManager (Pass *P, bool ProcessAnalysis = true);
|
||||
|
||||
// Initialize available analysis information.
|
||||
void initializeAnalysisInfo() {
|
||||
RequiredAnalysis.clear();
|
||||
AvailableAnalysis.clear();
|
||||
LastUser.clear();
|
||||
}
|
||||
@ -151,12 +147,6 @@ public:
|
||||
}
|
||||
|
||||
private:
|
||||
// Analysis required by the passes managed by this manager. This information
|
||||
// used while selecting pass manager during addPass. If a pass does not
|
||||
// preserve any analysis required by other passes managed by current
|
||||
// pass manager then new pass manager is used.
|
||||
std::vector<AnalysisID> RequiredAnalysis;
|
||||
|
||||
// Set of available Analysis. This information is used while scheduling
|
||||
// pass. If a pass requires an analysis which is not not available then
|
||||
// equired analysis pass is scheduled to run before the pass itself is
|
||||
@ -307,37 +297,16 @@ private:
|
||||
/// manager.
|
||||
bool PMDataManager::manageablePass(Pass *P) {
|
||||
|
||||
AnalysisUsage AnUsage;
|
||||
P->getAnalysisUsage(AnUsage);
|
||||
|
||||
// If this pass is not preserving information that is required by the other
|
||||
// passes managed by this manager then use new manager
|
||||
if (!AnUsage.getPreservesAll()) {
|
||||
const std::vector<AnalysisID> &PreservedSet = AnUsage.getPreservedSet();
|
||||
for (std::vector<AnalysisID>::iterator I = RequiredAnalysis.begin(),
|
||||
E = RequiredAnalysis.end(); I != E; ++I) {
|
||||
if (std::find(PreservedSet.begin(), PreservedSet.end(), *I) ==
|
||||
PreservedSet.end())
|
||||
// This analysis is not preserved. Need new manager.
|
||||
return false;
|
||||
}
|
||||
}
|
||||
// TODO
|
||||
// If this pass is not preserving information that is required by a
|
||||
// pass maintained by higher level pass manager then do not insert
|
||||
// this pass into current manager. Use new manager. For example,
|
||||
// For example, If FunctionPass F is not preserving ModulePass Info M1
|
||||
// that is used by another ModulePass M2 then do not insert F in
|
||||
// current function pass manager.
|
||||
return true;
|
||||
}
|
||||
|
||||
/// Augment RequiredAnalysis by adding analysis required by pass P.
|
||||
void PMDataManager::noteDownRequiredAnalysis(Pass *P) {
|
||||
AnalysisUsage AnUsage;
|
||||
P->getAnalysisUsage(AnUsage);
|
||||
const std::vector<AnalysisID> &RequiredSet = AnUsage.getRequiredSet();
|
||||
|
||||
// FIXME: What about duplicates ?
|
||||
RequiredAnalysis.insert(RequiredAnalysis.end(), RequiredSet.begin(),
|
||||
RequiredSet.end());
|
||||
|
||||
initializeAnalysisImpl(P);
|
||||
}
|
||||
|
||||
/// Augement AvailableAnalysis by adding analysis made available by pass P.
|
||||
void PMDataManager::noteDownAvailableAnalysis(Pass *P) {
|
||||
|
||||
@ -389,14 +358,14 @@ void PMDataManager::removeDeadPasses(Pass *P) {
|
||||
}
|
||||
}
|
||||
|
||||
/// Add pass P into the PassVector. Update RequiredAnalysis and
|
||||
/// Add pass P into the PassVector. Update
|
||||
/// AvailableAnalysis appropriately if ProcessAnalysis is true.
|
||||
void PMDataManager::addPassToManager (Pass *P,
|
||||
bool ProcessAnalysis) {
|
||||
|
||||
if (ProcessAnalysis) {
|
||||
// Take a note of analysis required and made available by this pass
|
||||
noteDownRequiredAnalysis(P);
|
||||
initializeAnalysisImpl(P);
|
||||
noteDownAvailableAnalysis(P);
|
||||
|
||||
// Remove the analysis not preserved by this pass
|
||||
|
Loading…
x
Reference in New Issue
Block a user