LLVM  8.0.1
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
llvm::PMDataManager Class Referenceabstract

PMDataManager provides the common place to manage the analysis data used by pass managers. More...

#include "llvm/IR/LegacyPassManagers.h"

Inheritance diagram for llvm::PMDataManager:
Inheritance graph
[legend]
Collaboration diagram for llvm::PMDataManager:
Collaboration graph
[legend]

Public Member Functions

 PMDataManager ()
 
virtual ~PMDataManager ()
 
virtual PassgetAsPass ()=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 PassgetOnTheFlyPass (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...
 
PassfindAnalysisPass (AnalysisID AID, bool Direction)
 Find the pass that implements Analysis AID. More...
 
PMTopLevelManagergetTopLevelManager ()
 
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

PMTopLevelManagerTPM
 
SmallVector< Pass *, 16 > PassVector
 
DenseMap< AnalysisID, Pass * > * InheritedAnalysis [PMT_Last]
 

Detailed Description

PMDataManager provides the common place to manage the analysis data used by pass managers.

Definition at line 303 of file LegacyPassManagers.h.

Constructor & Destructor Documentation

◆ PMDataManager()

llvm::PMDataManager::PMDataManager ( )
inlineexplicit

Definition at line 305 of file LegacyPassManagers.h.

References llvm::ARM_AM::add, F(), and P.

◆ ~PMDataManager()

PMDataManager::~PMDataManager ( )
virtual

Definition at line 1353 of file LegacyPassManager.cpp.

References P.

Member Function Documentation

◆ add()

void PMDataManager::add ( Pass P,
bool  ProcessAnalysis = true 
)

◆ addLowerLevelRequiredPass()

void PMDataManager::addLowerLevelRequiredPass ( Pass P,
Pass RequiredPass 
)
virtual

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 1326 of file LegacyPassManager.cpp.

References llvm::dbgs(), llvm::Pass::getPassName(), and llvm_unreachable.

◆ collectRequiredAndUsedAnalyses()

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 1143 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().

◆ dumpLastUses()

void PMDataManager::dumpLastUses ( Pass P,
unsigned  Offset 
) const

◆ dumpPassArguments()

void PMDataManager::dumpPassArguments ( ) const

Definition at line 1219 of file LegacyPassManager.cpp.

References llvm::dbgs(), and P.

◆ dumpPassInfo()

void PMDataManager::dumpPassInfo ( Pass P,
enum PassDebuggingString  S1,
enum PassDebuggingString  S2,
StringRef  Msg 
)

◆ dumpPreservedSet()

void PMDataManager::dumpPreservedSet ( const Pass P) const

◆ dumpRequiredSet()

void PMDataManager::dumpRequiredSet ( const Pass P) const

◆ dumpUsedSet()

void PMDataManager::dumpUsedSet ( const Pass P) const

◆ emitInstrCountChangedRemark()

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().

◆ findAnalysisPass()

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 1187 of file LegacyPassManager.cpp.

References I, and if().

◆ freePass()

void PMDataManager::freePass ( Pass P,
StringRef  Msg,
enum PassDebuggingString  DBG_STR 
)

◆ getAsPass()

virtual Pass* llvm::PMDataManager::getAsPass ( )
pure virtual

◆ getAvailableAnalysis()

DenseMap<AnalysisID, Pass*>* llvm::PMDataManager::getAvailableAnalysis ( )
inline

Definition at line 394 of file LegacyPassManagers.h.

◆ getDepth()

unsigned llvm::PMDataManager::getDepth ( ) const
inline

Definition at line 373 of file LegacyPassManagers.h.

References llvm::Depth.

Referenced by llvm::PMStack::push(), and llvm::PMTopLevelManager::setLastUser().

◆ getNumContainedPasses()

unsigned llvm::PMDataManager::getNumContainedPasses ( ) const
inline

◆ getOnTheFlyPass()

Pass * PMDataManager::getOnTheFlyPass ( Pass P,
AnalysisID  PI,
Function F 
)
virtual

Definition at line 1348 of file LegacyPassManager.cpp.

References llvm_unreachable.

◆ getPassManagerType()

virtual PassManagerType llvm::PMDataManager::getPassManagerType ( ) const
inlinevirtual

◆ getTopLevelManager()

PMTopLevelManager* llvm::PMDataManager::getTopLevelManager ( )
inline

Definition at line 370 of file LegacyPassManagers.h.

◆ initializeAnalysisImpl()

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 1170 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().

◆ initializeAnalysisInfo()

void llvm::PMDataManager::initializeAnalysisInfo ( )
inline

Initialize available analysis information.

Definition at line 342 of file LegacyPassManagers.h.

References llvm::PMT_Last.

Referenced by llvm::PMStack::pop().

◆ initSizeRemarkInfo()

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().

◆ isPassDebuggingExecutionsOrMore()

bool PMDataManager::isPassDebuggingExecutionsOrMore ( ) const
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().

◆ populateInheritedAnalysis()

void llvm::PMDataManager::populateInheritedAnalysis ( PMStack PMS)
inline

◆ preserveHigherLevelAnalysis()

bool PMDataManager::preserveHigherLevelAnalysis ( Pass P)

◆ recordAvailableAnalysis()

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 917 of file LegacyPassManager.cpp.

References assert(), llvm::PassInfo::getInterfacesImplemented(), llvm::Pass::getPassID(), and P.

Referenced by llvm::RGPassManager::runOnFunction(), llvm::LPPassManager::runOnFunction(), and llvm::PMTopLevelManager::schedulePass().

◆ removeDeadPasses()

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 1016 of file LegacyPassManager.cpp.

References llvm::dbgs(), llvm::SmallVectorBase::empty(), and llvm::Pass::getPassName().

Referenced by llvm::RGPassManager::runOnFunction(), and llvm::LPPassManager::runOnFunction().

◆ removeNotPreservedAnalysis()

void PMDataManager::removeNotPreservedAnalysis ( Pass P)

◆ setDepth()

void llvm::PMDataManager::setDepth ( unsigned  newDepth)
inline

Definition at line 374 of file LegacyPassManagers.h.

References llvm::Depth.

Referenced by llvm::PMStack::push().

◆ setTopLevelManager()

void llvm::PMDataManager::setTopLevelManager ( PMTopLevelManager T)
inline

◆ verifyPreservedAnalysis()

void PMDataManager::verifyPreservedAnalysis ( Pass P)

verifyPreservedAnalysis – Verify analysis presreved by pass P.

verifyPreservedAnalysis – Verify analysis preserved by pass P.

Definition at line 951 of file LegacyPassManager.cpp.

References llvm::getPassTimer(), and llvm::AnalysisUsage::getPreservedSet().

Referenced by llvm::RGPassManager::runOnFunction(), and llvm::LPPassManager::runOnFunction().

Member Data Documentation

◆ InheritedAnalysis

DenseMap<AnalysisID, Pass *>* llvm::PMDataManager::InheritedAnalysis[PMT_Last]
protected

Definition at line 437 of file LegacyPassManagers.h.

◆ PassVector

SmallVector<Pass *, 16> llvm::PMDataManager::PassVector
protected

Definition at line 432 of file LegacyPassManagers.h.

◆ TPM

PMTopLevelManager* llvm::PMDataManager::TPM
protected

The documentation for this class was generated from the following files: