LLVM 20.0.0git
|
PMTopLevelManager manages LastUser info and collects common APIs used by top level pass managers. More...
#include "llvm/IR/LegacyPassManagers.h"
Public Member Functions | |
void | schedulePass (Pass *P) |
Schedule pass P for execution. | |
void | setLastUser (ArrayRef< Pass * > AnalysisPasses, Pass *P) |
Set pass P as the last user of the given analysis passes. | |
void | collectLastUses (SmallVectorImpl< Pass * > &LastUses, Pass *P) |
Collect passes whose last user is P. | |
Pass * | findAnalysisPass (AnalysisID AID) |
Find the pass that implements Analysis AID. | |
const PassInfo * | findAnalysisPassInfo (AnalysisID AID) const |
Retrieve the PassInfo for an analysis. | |
AnalysisUsage * | findAnalysisUsage (Pass *P) |
Find analysis usage information for the pass P. | |
virtual | ~PMTopLevelManager () |
Destructor. | |
void | addImmutablePass (ImmutablePass *P) |
Add immutable pass and initialize it. | |
SmallVectorImpl< ImmutablePass * > & | getImmutablePasses () |
void | addPassManager (PMDataManager *Manager) |
void | addIndirectPassManager (PMDataManager *Manager) |
void | dumpPasses () const |
void | dumpArguments () const |
Public Attributes | |
PMStack | activeStack |
Protected Member Functions | |
PMTopLevelManager (PMDataManager *PMDM) | |
Initialize top level manager. Create first pass manager. | |
unsigned | getNumContainedManagers () const |
void | initializeAllAnalysisInfo () |
Protected Attributes | |
SmallVector< PMDataManager *, 8 > | PassManagers |
Collection of pass managers. | |
PMTopLevelManager manages LastUser info and collects common APIs used by top level pass managers.
Definition at line 158 of file LegacyPassManagers.h.
|
explicitprotected |
Initialize top level manager. Create first pass manager.
Definition at line 555 of file LegacyPassManager.cpp.
References activeStack, addPassManager(), llvm::PMStack::push(), and llvm::PMDataManager::setTopLevelManager().
|
virtual |
void PMTopLevelManager::addImmutablePass | ( | ImmutablePass * | P | ) |
Add immutable pass and initialize it.
Definition at line 799 of file LegacyPassManager.cpp.
References P.
Referenced by schedulePass().
|
inline |
Definition at line 210 of file LegacyPassManagers.h.
Referenced by llvm::CallGraphSCCPass::assignPassManager(), llvm::LoopPass::assignPassManager(), llvm::RegionPass::assignPassManager(), llvm::FunctionPass::assignPassManager(), and llvm::PMStack::push().
|
inline |
Definition at line 204 of file LegacyPassManagers.h.
References PassManagers.
Referenced by PMTopLevelManager().
void PMTopLevelManager::collectLastUses | ( | SmallVectorImpl< Pass * > & | LastUses, |
Pass * | P | ||
) |
Collect passes whose last user is P.
Definition at line 615 of file LegacyPassManager.cpp.
References llvm::SmallVectorImpl< T >::append(), and P.
Referenced by llvm::PMDataManager::dumpLastUses(), and llvm::PMDataManager::removeDeadPasses().
void PMTopLevelManager::dumpArguments | ( | ) | const |
Definition at line 828 of file LegacyPassManager.cpp.
References Arguments, assert(), llvm::dbgs(), findAnalysisPassInfo(), P, PassDebugging, and PassManagers.
Referenced by llvm::PMDataManager::addLowerLevelRequiredPass(), llvm::legacy::FunctionPassManagerImpl::doInitialization(), and llvm::legacy::PassManagerImpl::run().
void PMTopLevelManager::dumpPasses | ( | ) | const |
Definition at line 811 of file LegacyPassManager.cpp.
References llvm::Pass::dumpPassStructure(), PassDebugging, and PassManagers.
Referenced by llvm::PMDataManager::addLowerLevelRequiredPass(), llvm::legacy::FunctionPassManagerImpl::doInitialization(), and llvm::legacy::PassManagerImpl::run().
Pass * PMTopLevelManager::findAnalysisPass | ( | AnalysisID | AID | ) |
Find the pass that implements Analysis AID.
Search immutable passes and all pass managers. If desired pass is not found then return NULL.
Definition at line 769 of file LegacyPassManager.cpp.
References P, and PassManagers.
Referenced by llvm::PMDataManager::findAnalysisPass(), schedulePass(), and setLastUser().
const PassInfo * PMTopLevelManager::findAnalysisPassInfo | ( | AnalysisID | AID | ) | const |
Retrieve the PassInfo for an analysis.
Definition at line 788 of file LegacyPassManager.cpp.
References assert(), llvm::PassRegistry::getPassInfo(), getPassInfo(), and llvm::PassRegistry::getPassRegistry().
Referenced by llvm::PMDataManager::add(), dumpArguments(), llvm::PMDataManager::dumpPassArguments(), and schedulePass().
AnalysisUsage * PMTopLevelManager::findAnalysisUsage | ( | Pass * | P | ) |
Find analysis usage information for the pass P.
Definition at line 625 of file LegacyPassManager.cpp.
References llvm::SpecificBumpPtrAllocator< T >::Allocate(), assert(), llvm::FoldingSetImpl< Derived, T >::FindNodeOrInsertPos(), llvm::FoldingSetImpl< Derived, T >::InsertNode(), N, and P.
Referenced by llvm::PMDataManager::collectRequiredAndUsedAnalyses(), llvm::PMDataManager::initializeAnalysisImpl(), llvm::PMDataManager::preserveHigherLevelAnalysis(), llvm::PMDataManager::removeNotPreservedAnalysis(), schedulePass(), setLastUser(), and llvm::PMDataManager::verifyPreservedAnalysis().
|
inline |
Definition at line 200 of file LegacyPassManagers.h.
Referenced by llvm::legacy::FunctionPassManagerImpl::doFinalization(), llvm::legacy::FunctionPassManagerImpl::doInitialization(), and llvm::legacy::PassManagerImpl::run().
|
inlineprotected |
Definition at line 162 of file LegacyPassManagers.h.
References PassManagers.
Referenced by llvm::legacy::FunctionPassManagerImpl::doFinalization(), llvm::legacy::FunctionPassManagerImpl::doInitialization(), llvm::legacy::FunctionPassManagerImpl::dumpPassStructure(), llvm::legacy::FunctionPassManagerImpl::releaseMemoryOnTheFly(), llvm::legacy::FunctionPassManagerImpl::run(), and llvm::legacy::PassManagerImpl::run().
|
protected |
Definition at line 844 of file LegacyPassManager.cpp.
References PassManagers.
Referenced by llvm::legacy::FunctionPassManagerImpl::run(), and llvm::legacy::PassManagerImpl::run().
void PMTopLevelManager::schedulePass | ( | Pass * | P | ) |
Schedule pass P for execution.
Make sure that passes required by P are run before P is run. Update analysis info maintained by the manager. Remove dead passes. This is a recursive function.
Definition at line 661 of file LegacyPassManager.cpp.
References activeStack, addImmutablePass(), assert(), llvm::Pass::assignPassManager(), llvm::PassInfo::createPass(), llvm::dbgs(), DM, findAnalysisPass(), findAnalysisPassInfo(), findAnalysisUsage(), llvm::PassInfo::getPassArgument(), llvm::Pass::getPassName(), llvm::Pass::getPotentialPassManagerType(), llvm::AnalysisUsage::getRequiredSet(), llvm::PassInfo::isAnalysis(), P, schedulePass(), llvm::shouldPrintAfterPass(), and llvm::shouldPrintBeforePass().
Referenced by llvm::legacy::FunctionPassManagerImpl::add(), llvm::legacy::PassManagerImpl::add(), llvm::CallGraphSCCPass::assignPassManager(), llvm::LoopPass::assignPassManager(), llvm::RegionPass::assignPassManager(), and schedulePass().
Set pass P as the last user of the given analysis passes.
Definition at line 563 of file LegacyPassManager.cpp.
References assert(), findAnalysisPass(), findAnalysisUsage(), llvm::PMDataManager::getDepth(), llvm::AnalysisResolver::getPMDataManager(), llvm::AnalysisUsage::getRequiredTransitiveSet(), llvm::Pass::getResolver(), P, llvm::SmallVectorTemplateBase< T, bool >::push_back(), and setLastUser().
Referenced by llvm::PMDataManager::add(), and setLastUser().
PMStack llvm::PMTopLevelManager::activeStack |
Definition at line 219 of file LegacyPassManagers.h.
Referenced by PMTopLevelManager(), llvm::FPPassManager::runOnFunction(), llvm::LPPassManager::runOnFunction(), llvm::RGPassManager::runOnFunction(), and schedulePass().
|
protected |
Collection of pass managers.
Definition at line 223 of file LegacyPassManagers.h.
Referenced by addPassManager(), dumpArguments(), dumpPasses(), findAnalysisPass(), llvm::legacy::FunctionPassManagerImpl::getContainedManager(), llvm::legacy::PassManagerImpl::getContainedManager(), getNumContainedManagers(), initializeAllAnalysisInfo(), and ~PMTopLevelManager().