mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-08-17 21:29:20 +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;
|
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.
|
/// Augment AvailableAnalysis by adding analysis made available by pass P.
|
||||||
void noteDownAvailableAnalysis(Pass *P);
|
void noteDownAvailableAnalysis(Pass *P);
|
||||||
|
|
||||||
@ -119,13 +116,12 @@ public:
|
|||||||
/// Remove dead passes
|
/// Remove dead passes
|
||||||
void removeDeadPasses(Pass *P);
|
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.
|
/// AvailableAnalysis appropriately if ProcessAnalysis is true.
|
||||||
void addPassToManager (Pass *P, bool ProcessAnalysis = true);
|
void addPassToManager (Pass *P, bool ProcessAnalysis = true);
|
||||||
|
|
||||||
// Initialize available analysis information.
|
// Initialize available analysis information.
|
||||||
void initializeAnalysisInfo() {
|
void initializeAnalysisInfo() {
|
||||||
RequiredAnalysis.clear();
|
|
||||||
AvailableAnalysis.clear();
|
AvailableAnalysis.clear();
|
||||||
LastUser.clear();
|
LastUser.clear();
|
||||||
}
|
}
|
||||||
@ -151,12 +147,6 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
private:
|
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
|
// Set of available Analysis. This information is used while scheduling
|
||||||
// pass. If a pass requires an analysis which is not not available then
|
// 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
|
// equired analysis pass is scheduled to run before the pass itself is
|
||||||
@ -307,37 +297,16 @@ private:
|
|||||||
/// manager.
|
/// manager.
|
||||||
bool PMDataManager::manageablePass(Pass *P) {
|
bool PMDataManager::manageablePass(Pass *P) {
|
||||||
|
|
||||||
AnalysisUsage AnUsage;
|
// TODO
|
||||||
P->getAnalysisUsage(AnUsage);
|
// If this pass is not preserving information that is required by a
|
||||||
|
// pass maintained by higher level pass manager then do not insert
|
||||||
// If this pass is not preserving information that is required by the other
|
// this pass into current manager. Use new manager. For example,
|
||||||
// passes managed by this manager then use new manager
|
// For example, If FunctionPass F is not preserving ModulePass Info M1
|
||||||
if (!AnUsage.getPreservesAll()) {
|
// that is used by another ModulePass M2 then do not insert F in
|
||||||
const std::vector<AnalysisID> &PreservedSet = AnUsage.getPreservedSet();
|
// current function pass manager.
|
||||||
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;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return true;
|
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.
|
/// Augement AvailableAnalysis by adding analysis made available by pass P.
|
||||||
void PMDataManager::noteDownAvailableAnalysis(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.
|
/// AvailableAnalysis appropriately if ProcessAnalysis is true.
|
||||||
void PMDataManager::addPassToManager (Pass *P,
|
void PMDataManager::addPassToManager (Pass *P,
|
||||||
bool ProcessAnalysis) {
|
bool ProcessAnalysis) {
|
||||||
|
|
||||||
if (ProcessAnalysis) {
|
if (ProcessAnalysis) {
|
||||||
// Take a note of analysis required and made available by this pass
|
// Take a note of analysis required and made available by this pass
|
||||||
noteDownRequiredAnalysis(P);
|
initializeAnalysisImpl(P);
|
||||||
noteDownAvailableAnalysis(P);
|
noteDownAvailableAnalysis(P);
|
||||||
|
|
||||||
// Remove the analysis not preserved by this pass
|
// Remove the analysis not preserved by this pass
|
||||||
|
Loading…
Reference in New Issue
Block a user