|
LLVM
10.0.0
|
PMDataManager provides the common place to manage the analysis data used by pass managers. More...
#include "llvm/IR/LegacyPassManagers.h"
Public Member Functions | |
| PMDataManager () | |
| virtual | ~PMDataManager () |
| virtual Pass * | getAsPass ()=0 |
| void | recordAvailableAnalysis (Pass *P) |
| Augment AvailableAnalysis by adding analysis made available by pass P. More... | |
| void | verifyPreservedAnalysis (Pass *P) |
| verifyPreservedAnalysis – Verify analysis presreved by pass P. More... | |
| void | removeNotPreservedAnalysis (Pass *P) |
| Remove Analysis that is not preserved by the pass. More... | |
| void | removeDeadPasses (Pass *P, StringRef Msg, enum PassDebuggingString) |
| Remove dead passes used by P. More... | |
| void | freePass (Pass *P, StringRef Msg, enum PassDebuggingString) |
| Remove P. More... | |
| void | add (Pass *P, bool ProcessAnalysis=true) |
| Add pass P into the PassVector. More... | |
| virtual void | addLowerLevelRequiredPass (Pass *P, Pass *RequiredPass) |
| Add RequiredPass into list of lower level passes required by pass P. More... | |
| virtual Pass * | getOnTheFlyPass (Pass *P, AnalysisID PI, Function &F) |
| void | initializeAnalysisInfo () |
| Initialize available analysis information. More... | |
| bool | preserveHigherLevelAnalysis (Pass *P) |
| void | collectRequiredAndUsedAnalyses (SmallVectorImpl< Pass *> &UsedPasses, SmallVectorImpl< AnalysisID > &ReqPassNotAvailable, Pass *P) |
| Populate UsedPasses with analysis pass that are used or required by pass P and are available. More... | |
| void | initializeAnalysisImpl (Pass *P) |
| All Required analyses should be available to the pass as it runs! Here we fill in the AnalysisImpls member of the pass so that it can successfully use the getAnalysis() method to retrieve the implementations it needs. More... | |
| Pass * | findAnalysisPass (AnalysisID AID, bool Direction) |
| Find the pass that implements Analysis AID. More... | |
| PMTopLevelManager * | getTopLevelManager () |
| void | setTopLevelManager (PMTopLevelManager *T) |
| unsigned | getDepth () const |
| void | setDepth (unsigned newDepth) |
| void | dumpLastUses (Pass *P, unsigned Offset) const |
| void | dumpPassArguments () const |
| void | dumpPassInfo (Pass *P, enum PassDebuggingString S1, enum PassDebuggingString S2, StringRef Msg) |
| void | dumpRequiredSet (const Pass *P) const |
| void | dumpPreservedSet (const Pass *P) const |
| void | dumpUsedSet (const Pass *P) const |
| unsigned | getNumContainedPasses () const |
| virtual PassManagerType | getPassManagerType () const |
| DenseMap< AnalysisID, Pass * > * | getAvailableAnalysis () |
| void | populateInheritedAnalysis (PMStack &PMS) |
| unsigned | initSizeRemarkInfo (Module &M, StringMap< std::pair< unsigned, unsigned >> &FunctionToInstrCount) |
| Set the initial size of the module if the user has specified that they want remarks for size. More... | |
| void | emitInstrCountChangedRemark (Pass *P, Module &M, int64_t Delta, unsigned CountBefore, StringMap< std::pair< unsigned, unsigned >> &FunctionToInstrCount, Function *F=nullptr) |
| Emit a remark signifying that the number of IR instructions in the module changed. More... | |
Protected Member Functions | |
| bool | isPassDebuggingExecutionsOrMore () const |
| isPassDebuggingExecutionsOrMore - Return true if -debug-pass=Executions or higher is specified. More... | |
Protected Attributes | |
| PMTopLevelManager * | TPM |
| SmallVector< Pass *, 16 > | PassVector |
| DenseMap< AnalysisID, Pass * > * | InheritedAnalysis [PMT_Last] |
PMDataManager provides the common place to manage the analysis data used by pass managers.
Definition at line 297 of file LegacyPassManagers.h.
|
inlineexplicit |
Definition at line 299 of file LegacyPassManagers.h.
|
virtual |
Definition at line 1297 of file LegacyPassManager.cpp.
References P.
Add pass P into the PassVector.
Update AvailableAnalysis appropriately if ProcessAnalysis is true.
Definition at line 1015 of file LegacyPassManager.cpp.
References assert(), llvm::SmallVectorImpl< T >::clear(), llvm::PassInfo::createPass(), DM, llvm::SmallVectorBase::empty(), llvm::Pass::getAsPMDataManager(), getDepth(), llvm_unreachable, llvm::SmallVectorTemplateBase< T >::push_back(), llvm::SmallVectorTemplateBase< T, bool >::push_back(), and llvm::Pass::setResolver().
Referenced by llvm::LoopPass::assignPassManager(), llvm::RegionPass::assignPassManager(), llvm::ModulePass::assignPassManager(), and llvm::FunctionPass::assignPassManager().
Add RequiredPass into list of lower level passes required by pass P.
RequiredPass is run on the fly by Pass Manager when P requests it through getAnalysis interface.
RequiredPass is run on the fly by Pass Manager when P requests it through getAnalysis interface. This should be handled by specific pass manager.
Definition at line 1270 of file LegacyPassManager.cpp.
References llvm::dbgs(), llvm::Pass::getPassName(), and llvm_unreachable.
| void PMDataManager::collectRequiredAndUsedAnalyses | ( | SmallVectorImpl< Pass *> & | UP, |
| SmallVectorImpl< AnalysisID > & | RP_NotAvail, | ||
| Pass * | P | ||
| ) |
Populate UsedPasses with analysis pass that are used or required by pass P and are available.
Populate UP with analysis pass that are used or required by pass P and are available.
Populate ReqPassNotAvailable with analysis pass that are required by pass P but are not available.
Populate RP_NotAvail with analysis pass that are required by pass P but are not available.
Definition at line 1090 of file LegacyPassManager.cpp.
References llvm::AnalysisUsage::getRequiredSet(), llvm::AnalysisUsage::getRequiredTransitiveSet(), llvm::AnalysisUsage::getUsedSet(), llvm::SmallVectorTemplateBase< T, bool >::push_back(), and llvm::SmallVectorTemplateBase< T >::push_back().
Definition at line 1150 of file LegacyPassManager.cpp.
References llvm::dbgs(), and llvm::Pass::dumpPassStructure().
Referenced by llvm::RGPassManager::dumpPassStructure(), and llvm::LPPassManager::dumpPassStructure().
| void PMDataManager::dumpPassArguments | ( | ) | const |
Definition at line 1166 of file LegacyPassManager.cpp.
References llvm::dbgs(), and P.
| void PMDataManager::dumpPassInfo | ( | Pass * | P, |
| enum PassDebuggingString | S1, | ||
| enum PassDebuggingString | S2, | ||
| StringRef | Msg | ||
| ) |
Definition at line 1178 of file LegacyPassManager.cpp.
References llvm::dbgs(), llvm::EXECUTION_MSG, llvm::FREEING_MSG, getDepth(), llvm::Pass::getPassName(), llvm::MODIFICATION_MSG, now(), llvm::ON_CG_MSG, llvm::ON_FUNCTION_MSG, llvm::ON_LOOP_MSG, llvm::ON_MODULE_MSG, and llvm::ON_REGION_MSG.
Referenced by llvm::RGPassManager::runOnFunction(), and llvm::LPPassManager::runOnFunction().
Definition at line 1228 of file LegacyPassManager.cpp.
References llvm::Pass::getAnalysisUsage(), and llvm::AnalysisUsage::getPreservedSet().
Referenced by llvm::RGPassManager::runOnFunction(), and llvm::LPPassManager::runOnFunction().
Definition at line 1219 of file LegacyPassManager.cpp.
References llvm::Pass::getAnalysisUsage(), and llvm::AnalysisUsage::getRequiredSet().
Referenced by llvm::RGPassManager::runOnFunction(), and llvm::LPPassManager::runOnFunction().
Definition at line 1237 of file LegacyPassManager.cpp.
References assert(), llvm::dbgs(), llvm::SmallVectorBase::empty(), llvm::Pass::getAnalysisUsage(), getDepth(), llvm::PassInfo::getPassName(), llvm::AnalysisUsage::getUsedSet(), P, and llvm::SmallVectorBase::size().
| void PMDataManager::emitInstrCountChangedRemark | ( | Pass * | P, |
| Module & | M, | ||
| int64_t | Delta, | ||
| unsigned | CountBefore, | ||
| StringMap< std::pair< unsigned, unsigned >> & | FunctionToInstrCount, | ||
| Function * | F = nullptr |
||
| ) |
Emit a remark signifying that the number of IR instructions in the module changed.
F is optionally passed by passes which run on Functions, and thus always know whether or not a non-empty function is available.
FunctionToInstrCount maps the name of a Function to a pair. The first member of the pair is the IR count of the Function before running P, and the second member is the IR count of the Function after running P.
Definition at line 165 of file LegacyPassManager.cpp.
References llvm::Module::begin(), llvm::Function::begin(), llvm::LLVMContext::diagnose(), llvm::Module::end(), F(), llvm::find_if(), llvm::for_each(), llvm::Pass::getAsPMDataManager(), llvm::Function::getContext(), llvm::Pass::getPassName(), and llvm::StringRef::str().
Referenced by llvm::LPPassManager::runOnFunction().
| Pass * PMDataManager::findAnalysisPass | ( | AnalysisID | AID, |
| bool | SearchParent | ||
| ) |
Find the pass that implements Analysis AID.
If desired pass is not found then return NULL.
Definition at line 1134 of file LegacyPassManager.cpp.
| void PMDataManager::freePass | ( | Pass * | P, |
| StringRef | Msg, | ||
| enum PassDebuggingString | DBG_STR | ||
| ) |
Remove P.
Definition at line 984 of file LegacyPassManager.cpp.
References llvm::numbers::e, llvm::FREEING_MSG, llvm::Pass::getPassID(), llvm::getPassTimer(), P, llvm::Pass::releaseMemory(), and X.
Referenced by llvm::RGPassManager::runOnFunction(), and llvm::LPPassManager::runOnFunction().
|
pure virtual |
Implemented in llvm::legacy::PassManagerImpl, llvm::FPPassManager, llvm::legacy::FunctionPassManagerImpl, llvm::LPPassManager, and llvm::RGPassManager.
Referenced by llvm::PMTopLevelManager::setLastUser().
|
inline |
Definition at line 388 of file LegacyPassManagers.h.
|
inline |
Definition at line 367 of file LegacyPassManagers.h.
References llvm::Depth.
Referenced by llvm::PMStack::push(), and llvm::PMTopLevelManager::setLastUser().
|
inline |
Definition at line 379 of file LegacyPassManagers.h.
Referenced by llvm::LPPassManager::cloneBasicBlockSimpleAnalysis(), llvm::LPPassManager::deleteSimpleAnalysisLoop(), llvm::LPPassManager::deleteSimpleAnalysisValue(), llvm::RGPassManager::dumpPassStructure(), llvm::LPPassManager::dumpPassStructure(), llvm::legacy::FunctionPassManagerImpl::releaseMemoryOnTheFly(), llvm::RGPassManager::runOnFunction(), and llvm::LPPassManager::runOnFunction().
|
virtual |
Definition at line 1292 of file LegacyPassManager.cpp.
References llvm_unreachable.
|
inlinevirtual |
Reimplemented in llvm::FPPassManager, llvm::LPPassManager, and llvm::RGPassManager.
Definition at line 383 of file LegacyPassManagers.h.
References assert(), and llvm::PMT_Unknown.
Referenced by llvm::LoopPass::assignPassManager(), llvm::CallGraphSCCPass::assignPassManager(), llvm::RegionPass::assignPassManager(), llvm::ModulePass::assignPassManager(), llvm::FunctionPass::assignPassManager(), llvm::LoopPass::preparePassManager(), llvm::RegionPass::preparePassManager(), and llvm::PMStack::push().
|
inline |
Definition at line 364 of file LegacyPassManagers.h.
Referenced by llvm::FunctionPass::assignPassManager().
| void PMDataManager::initializeAnalysisImpl | ( | Pass * | P | ) |
All Required analyses should be available to the pass as it runs! Here we fill in the AnalysisImpls member of the pass so that it can successfully use the getAnalysis() method to retrieve the implementations it needs.
Definition at line 1117 of file LegacyPassManager.cpp.
References llvm::AnalysisResolver::addAnalysisImplsPair(), assert(), llvm::AnalysisUsage::getRequiredSet(), and llvm::Pass::getResolver().
Referenced by llvm::RGPassManager::runOnFunction(), llvm::LPPassManager::runOnFunction(), and llvm::PMTopLevelManager::schedulePass().
|
inline |
Initialize available analysis information.
Definition at line 336 of file LegacyPassManagers.h.
References llvm::PMT_Last.
Referenced by llvm::PMStack::pop().
| unsigned PMDataManager::initSizeRemarkInfo | ( | Module & | M, |
| StringMap< std::pair< unsigned, unsigned >> & | FunctionToInstrCount | ||
| ) |
Set the initial size of the module if the user has specified that they want remarks for size.
Returns 0 if the remark was not requested.
Definition at line 143 of file LegacyPassManager.cpp.
References F(), and InstrCount.
Referenced by llvm::LPPassManager::runOnFunction().
|
protected |
isPassDebuggingExecutionsOrMore - Return true if -debug-pass=Executions or higher is specified.
Definition at line 139 of file LegacyPassManager.cpp.
Referenced by llvm::RGPassManager::runOnFunction().
|
inline |
Definition at line 393 of file LegacyPassManagers.h.
References llvm::PMStack::begin(), E, llvm::PMStack::end(), and I.
Referenced by llvm::LoopPass::assignPassManager(), llvm::RegionPass::assignPassManager(), llvm::FunctionPass::assignPassManager(), llvm::RGPassManager::runOnFunction(), and llvm::LPPassManager::runOnFunction().
Definition at line 882 of file LegacyPassManager.cpp.
References llvm::AnalysisUsage::getPreservedSet(), llvm::AnalysisUsage::getPreservesAll(), and llvm::is_contained().
Referenced by llvm::LoopPass::preparePassManager(), and llvm::RegionPass::preparePassManager().
| void PMDataManager::recordAvailableAnalysis | ( | Pass * | P | ) |
Augment AvailableAnalysis by adding analysis made available by pass P.
Augement AvailableAnalysis by adding analysis made available by pass P.
Definition at line 864 of file LegacyPassManager.cpp.
References assert(), llvm::numbers::e, llvm::PassInfo::getInterfacesImplemented(), llvm::Pass::getPassID(), and P.
Referenced by llvm::RGPassManager::runOnFunction(), llvm::LPPassManager::runOnFunction(), and llvm::PMTopLevelManager::schedulePass().
| void PMDataManager::removeDeadPasses | ( | Pass * | P, |
| StringRef | Msg, | ||
| enum PassDebuggingString | DBG_STR | ||
| ) |
Remove dead passes used by P.
Remove analysis passes that are not used any longer.
Definition at line 963 of file LegacyPassManager.cpp.
References llvm::dbgs(), llvm::SmallVectorBase::empty(), and llvm::Pass::getPassName().
Referenced by llvm::RGPassManager::runOnFunction(), and llvm::LPPassManager::runOnFunction().
| void PMDataManager::removeNotPreservedAnalysis | ( | Pass * | P | ) |
Remove Analysis that is not preserved by the pass.
Remove Analysis not preserved by Pass P.
Definition at line 916 of file LegacyPassManager.cpp.
References llvm::sys::path::begin(), llvm::dbgs(), E, llvm::sys::path::end(), llvm::Pass::getPassName(), llvm::AnalysisUsage::getPreservedSet(), llvm::AnalysisUsage::getPreservesAll(), I, Info, llvm::is_contained(), and llvm::PMT_Last.
Referenced by llvm::RGPassManager::runOnFunction(), and llvm::LPPassManager::runOnFunction().
|
inline |
Definition at line 368 of file LegacyPassManagers.h.
References llvm::Depth.
Referenced by llvm::PMStack::push().
|
inline |
Definition at line 365 of file LegacyPassManagers.h.
References llvm::T.
Referenced by llvm::FPPassManager::doFinalization(), llvm::legacy::FunctionPassManager::FunctionPassManager(), llvm::PMTopLevelManager::PMTopLevelManager(), and llvm::PMStack::push().
| void PMDataManager::verifyPreservedAnalysis | ( | Pass * | P | ) |
verifyPreservedAnalysis – Verify analysis presreved by pass P.
verifyPreservedAnalysis – Verify analysis preserved by pass P.
Definition at line 898 of file LegacyPassManager.cpp.
References llvm::getPassTimer(), and llvm::AnalysisUsage::getPreservedSet().
Referenced by llvm::RGPassManager::runOnFunction(), and llvm::LPPassManager::runOnFunction().
|
protected |
Definition at line 431 of file LegacyPassManagers.h.
|
protected |
Definition at line 426 of file LegacyPassManagers.h.
|
protected |
Definition at line 423 of file LegacyPassManagers.h.
Referenced by llvm::LoopPass::assignPassManager(), llvm::RegionPass::assignPassManager(), llvm::RGPassManager::runOnFunction(), and llvm::LPPassManager::runOnFunction().
1.8.13