LLVM API Documentation

Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

llvm::Pass Class Reference

#include <Pass.h>

Inheritance diagram for llvm::Pass:

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

Collaboration graph
[legend]
List of all members.

Public Member Functions

 Pass (intptr_t pid)
 Pass (const void *pid)
virtual ~Pass ()
virtual const char * getPassName () const
const PassInfogetPassInfo () const
virtual void print (std::ostream &O, const Module *M) const
void print (std::ostream *O, const Module *M) const
void dump () const
virtual void assignPassManager (PMStack &, PassManagerType=PMT_Unknown)
virtual void preparePassManager (PMStack &)
 Check if available pass managers are suitable for this pass or not.
virtual PassManagerType getPotentialPassManagerType () const
 Return what kind of Pass Manager can manage this pass.
void setResolver (AnalysisResolver *AR)
AnalysisResolvergetResolver ()
virtual void getAnalysisUsage (AnalysisUsage &) const
virtual void releaseMemory ()
virtual void verifyAnalysis () const
virtual void dumpPassStructure (unsigned Offset=0)
template<typename AnalysisType>
AnalysisType * getAnalysisToUpdate () const
bool mustPreserveAnalysisID (const PassInfo *AnalysisID) const
template<typename AnalysisType>
AnalysisType & getAnalysis () const
template<typename AnalysisType>
AnalysisType & getAnalysis (Function &F)
template<typename AnalysisType>
AnalysisType & getAnalysisID (const PassInfo *PI) const
template<typename AnalysisType>
AnalysisType & getAnalysisID (const PassInfo *PI, Function &F)

Static Public Member Functions

template<typename AnalysisClass>
const PassInfogetClassPassInfo ()
const PassInfolookupPassInfo (intptr_t TI)

Detailed Description

Pass interface - Implemented by all 'passes'. Subclass this if you are an interprocedural optimization or you do not fit into any of the more constrained passes described below.

Definition at line 73 of file Pass.h.


Constructor & Destructor Documentation

llvm::Pass::Pass intptr_t  pid  )  [inline, explicit]
 

Definition at line 84 of file Pass.h.

llvm::Pass::Pass const void *  pid  )  [inline, explicit]
 

Definition at line 85 of file Pass.h.

Pass::~Pass  )  [virtual]
 

Definition at line 32 of file Pass.cpp.


Member Function Documentation

virtual void llvm::Pass::assignPassManager PMStack ,
PassManagerType  = PMT_Unknown
[inline, virtual]
 

Each pass is responsible for assigning a pass manager to itself. PMS is the stack of available pass manager.

Reimplemented in llvm::LoopPass, llvm::CallGraphSCCPass, llvm::ModulePass, llvm::FunctionPass, and llvm::BasicBlockPass.

Definition at line 112 of file Pass.h.

Referenced by llvm::PassManagerImpl::addTopLevelPass(), and llvm::FunctionPassManagerImpl::addTopLevelPass().

void Pass::dump  )  const
 

Reimplemented in BasicCallGraph.

Definition at line 67 of file Pass.cpp.

References print().

Referenced by llvm::SimpleRegisterCoalescing::runOnMachineFunction(), llvm::LiveIntervals::runOnMachineFunction(), and llvm::PMDataManager::verifyDomInfo().

void Pass::dumpPassStructure unsigned  Offset = 0  )  [virtual]
 

Reimplemented in llvm::LPPassManager, llvm::FPPassManager, CGPassManager, BBPassManager, and llvm::MPPassManager.

Definition at line 44 of file Pass.cpp.

References getPassName().

Referenced by llvm::PMTopLevelManager::dumpPasses(), llvm::FPPassManager::dumpPassStructure(), llvm::MPPassManager::dumpPassStructure(), BBPassManager::dumpPassStructure(), llvm::LPPassManager::dumpPassStructure(), and CGPassManager::dumpPassStructure().

template<typename AnalysisType>
AnalysisType & llvm::Pass::getAnalysis Function F  ) 
 

getAnalysis<AnalysisType>() - This function is used by subclasses to get to the analysis information that they claim to use by overriding the getAnalysisUsage function.

Definition at line 210 of file PassAnalysisSupport.h.

template<typename AnalysisType>
AnalysisType & llvm::Pass::getAnalysis  )  const
 

getAnalysis<AnalysisType>() - This function is used by subclasses to get to the analysis information that they claim to use by overriding the getAnalysisUsage function.

Definition at line 177 of file PassAnalysisSupport.h.

Referenced by IndVarSimplify::doInitialization(), llvm::AliasAnalysis::InitializeAliasAnalysis(), LoopRotate::preserveCanonicalLoopForm(), LCSSA::runOnLoop(), and llvm::SplitBlock().

template<typename AnalysisType>
AnalysisType & llvm::Pass::getAnalysisID const PassInfo PI,
Function F
 

Definition at line 217 of file PassAnalysisSupport.h.

References llvm::AnalysisResolver::findImplPass().

template<typename AnalysisType>
AnalysisType & llvm::Pass::getAnalysisID const PassInfo PI  )  const
 

Definition at line 184 of file PassAnalysisSupport.h.

References llvm::AnalysisResolver::findImplPass().

template<typename AnalysisType>
AnalysisType * llvm::Pass::getAnalysisToUpdate  )  const
 

getAnalysisToUpdate<AnalysisType>() - This function is used by subclasses to get to the analysis information that might be around that needs to be updated. This is different than getAnalysis in that it can fail (ie the analysis results haven't been computed), so should only be used if you provide the capability to update an analysis that exists. This method is often used by transformation APIs to update analysis results for a pass automatically as the transform is performed.

Definition at line 163 of file PassAnalysisSupport.h.

References llvm::AnalysisResolver::getAnalysisToUpdate().

Referenced by llvm::CloneLoop(), llvm::SplitBlock(), llvm::SplitBlockPredecessors(), llvm::SplitCriticalEdge(), and llvm::PMDataManager::verifyDomInfo().

virtual void llvm::Pass::getAnalysisUsage AnalysisUsage  )  const [inline, virtual]
 

getAnalysisUsage - This function should be overriden by passes that need analysis information to do their job. If a pass specifies that it uses a particular analysis result to this function, it can then use the getAnalysis<AnalysisType>() function, below.

Reimplemented in llvm::DominatorTree, llvm::DominanceFrontier, llvm::FindUsedTypes, llvm::IntervalPartition, llvm::LibCallAliasAnalysis, llvm::LoopInfo, llvm::LPPassManager, llvm::LoopVR, llvm::MemoryDependenceAnalysis, llvm::PostDominatorTree, llvm::PostDominanceFrontier, llvm::ScalarEvolution, llvm::PrintModulePass, llvm::PrintFunctionPass, llvm::CallGraphSCCPass, llvm::AsmPrinter, llvm::LiveIntervals, llvm::LiveStacks, llvm::LiveVariables, llvm::MachineDominatorTree, llvm::MachineLoopInfo, llvm::SelectionDAGISel, llvm::FPPassManager, llvm::Inliner, llvm::UnifyFunctionExitNodes, AliasAnalysisCounter, AAEval, AliasDebugger, AliasSetPrinter, NoAA, CFGViewer, CFGOnlyViewer, CFGPrinter, CFGOnlyPrinter, InstCount, Andersens, BasicCallGraph, CGPassManager, GlobalsModRef, LoadVN, LoaderPass, LowerIntrinsics, MachineCodeAnalysis, Printer, Deleter, LoopAligner, Printer, MachineLICM, MachineSinking, PNE, RABigBlock, RALinScan, RALocal, RegAllocSimple, llvm::SimpleRegisterCoalescing, StackSlotColoring, StrongPHIElimination, TwoAddressInstructionPass, ARMAsmPrinter, CBackendNameAllUsedStructsAndMergeFunctions, CWriter, LinuxAsmPrinter, MSILModule, MSILWriter, PIC16AsmPrinter, LinuxAsmPrinter, DarwinAsmPrinter, llvm::X86ATTAsmPrinter, Emitter, Hello2, NullProfilerRS, ProfilerRS, llvm::RSProfilers_std, ArgPromotion, DTE, GlobalOpt, LoopExtractor, StripSymbols, SRETPromotion, ADCE, BlockPlacement, CondProp, ConstantPropagation, DeadInstElimination, DCE, DSE, IndVarSimplify, InstCombiner, LICM, LoopDeletion, LoopIndexSplit, LoopRotate, LoopStrengthReduce, LoopUnroll, LoopUnswitch, PredicateSimplifier, Reassociate, RegToMem, SROA, SCCP, SimplifyLibCalls, BreakCriticalEdges, LCSSA, LoopSimplify, LowerAllocations, LowerInvoke, LowerSwitch, PromotePass, BBPassManager, llvm::FunctionPassManagerImpl, llvm::MPPassManager, llvm::PassManagerImpl, and Verifier.

Definition at line 136 of file Pass.h.

Referenced by llvm::PMDataManager::collectRequiredAnalysis(), llvm::SimpleRegisterCoalescing::getAnalysisUsage(), llvm::LiveIntervals::getAnalysisUsage(), llvm::AsmPrinter::getAnalysisUsage(), llvm::PMDataManager::initializeAnalysisImpl(), llvm::PMDataManager::preserveHigherLevelAnalysis(), llvm::PMDataManager::removeNotPreservedAnalysis(), llvm::FPPassManager::runOnFunction(), BBPassManager::runOnFunction(), llvm::LPPassManager::runOnFunction(), llvm::MPPassManager::runOnModule(), CGPassManager::runOnModule(), llvm::PMTopLevelManager::schedulePass(), and llvm::PMDataManager::verifyPreservedAnalysis().

template<typename AnalysisClass>
const PassInfo* llvm::Pass::getClassPassInfo  )  [inline, static]
 

Definition at line 161 of file Pass.h.

const PassInfo * Pass::getPassInfo  )  const
 

getPassInfo - Return the PassInfo data structure that corresponds to this pass... If the pass has not been registered, this will return null.

Definition at line 202 of file Pass.cpp.

References lookupPassInfo().

Referenced by llvm::PMTopLevelManager::findAnalysisPass(), getPassName(), llvm::PMDataManager::preserveHigherLevelAnalysis(), llvm::PMDataManager::recordAvailableAnalysis(), and llvm::PMTopLevelManager::schedulePass().

const char * Pass::getPassName  )  const [virtual]
 

getPassName - Return a nice clean name for a pass. This usually implemented in terms of the name that is registered by one of the Registration templates, but can be overloaded directly.

Reimplemented in llvm::LPPassManager, llvm::FPPassManager, CGPassManager, LoaderPass, WriteBitcodePass, BranchFolder, LowerIntrinsics, MachineCodeAnalysis, Printer, Deleter, IfConverter, LoopAligner, LowerSubregsInstructionPass, Printer, Deleter, llvm::DebugLabelFolder, llvm::MachOWriter, SchedulePostRATDList, PEI, RABigBlock, RALinScan, RALocal, RegAllocSimple, StackSlotColoring, AlphaAsmPrinter, AlphaBSel, AlphaCodeEmitter, AlphaDAGToDAGISel, AlphaLLRPPass, ARMAsmPrinter, Emitter, ARMConstantIslands, ARMDAGToDAGISel, ARMLoadStoreOpt, CBackendNameAllUsedStructsAndMergeFunctions, CWriter, SPUAsmPrinter, LinuxAsmPrinter, SPUDAGToDAGISel, CppWriter, IA64AsmPrinter, IA64BundlingPass, IA64DAGToDAGISel, MipsAsmPrinter, Filler, MipsDAGToDAGISel, MSILModule, MSILWriter, PIC16AsmPrinter, PIC16DAGToDAGISel, PPCAsmPrinter, LinuxAsmPrinter, DarwinAsmPrinter, PPCBSel, PPCCodeEmitter, PPCDAGToDAGISel, Filler, FPMover, SparcAsmPrinter, SparcDAGToDAGISel, llvm::X86ATTAsmPrinter, Emitter, FPS, llvm::X86IntelAsmPrinter, X86DAGToDAGISel, MSAC, BBPassManager, and llvm::MPPassManager.

Definition at line 52 of file Pass.cpp.

References getPassInfo(), and llvm::PassInfo::getPassName().

Referenced by llvm::PMDataManager::addLowerLevelRequiredPass(), llvm::PMStack::dump(), llvm::PMDataManager::dumpAnalysisSetInfo(), llvm::PMDataManager::dumpPassInfo(), dumpPassStructure(), print(), llvm::PMDataManager::removeDeadPasses(), llvm::PMDataManager::removeNotPreservedAnalysis(), and llvm::PMDataManager::verifyDomInfo().

virtual PassManagerType llvm::Pass::getPotentialPassManagerType  )  const [inline, virtual]
 

Return what kind of Pass Manager can manage this pass.

Reimplemented in llvm::LoopPass, llvm::CallGraphSCCPass, llvm::ModulePass, llvm::FunctionPass, and llvm::BasicBlockPass.

Definition at line 118 of file Pass.h.

References llvm::PassManagerType.

Referenced by llvm::MPPassManager::addLowerLevelRequiredPass(), and llvm::PMTopLevelManager::schedulePass().

AnalysisResolver* llvm::Pass::getResolver  )  [inline]
 

Definition at line 127 of file Pass.h.

Referenced by llvm::PMDataManager::add(), llvm::PMDataManager::initializeAnalysisImpl(), and llvm::PMDataManager::verifyDomInfo().

const PassInfo * Pass::lookupPassInfo intptr_t  TI  )  [static]
 

Definition at line 206 of file Pass.cpp.

References PassRegistrar::GetPassInfo(), and getPassRegistrar().

Referenced by getPassInfo().

bool Pass::mustPreserveAnalysisID const PassInfo AnalysisID  )  const
 

mustPreserveAnalysisID - This method serves the same function as getAnalysisToUpdate, but works if you just have an AnalysisID. This obviously cannot give you a properly typed instance of the class if you don't have the class name available (use getAnalysisToUpdate if you do), but it can tell you if you need to preserve the pass at least.

Definition at line 39 of file Pass.cpp.

References llvm::AnalysisID, and llvm::AnalysisResolver::getAnalysisToUpdate().

Referenced by InstCombiner::runOnFunction().

virtual void llvm::Pass::preparePassManager PMStack  )  [inline, virtual]
 

Check if available pass managers are suitable for this pass or not.

Reimplemented in llvm::LoopPass.

Definition at line 115 of file Pass.h.

Referenced by llvm::PMTopLevelManager::schedulePass().

void llvm::Pass::print std::ostream *  O,
const Module M
const [inline]
 

Reimplemented in llvm::DominanceFrontierBase, llvm::FindUsedTypes, llvm::IntervalPartition, llvm::ScalarEvolution, llvm::LiveIntervals, llvm::LiveStacks, BasicCallGraph, and llvm::SimpleRegisterCoalescing.

Definition at line 107 of file Pass.h.

void Pass::print std::ostream &  O,
const Module M
const [virtual]
 

print - Print out the internal state of the pass. This is called by Analyze to print out the contents of an analysis. Otherwise it is not necessary to implement this method. Beware that the module pointer MAY be null. This automatically forwards to a virtual function that does not provide the Module* in case the analysis doesn't need it it can just be ignored.

Reimplemented in llvm::DominatorTree, llvm::DominanceFrontierBase, llvm::FindUsedTypes, llvm::IntervalPartition, llvm::LoopInfo, llvm::LoopVR, llvm::PostDominatorTree, llvm::ScalarEvolution, llvm::LiveIntervals, llvm::LiveStacks, llvm::MachineDominatorTree, CFGViewer, CFGOnlyViewer, CFGPrinter, CFGOnlyPrinter, InstCount, BasicCallGraph, and llvm::SimpleRegisterCoalescing.

Definition at line 62 of file Pass.cpp.

References getPassName().

Referenced by dump(), llvm::operator<<(), and llvm::MachineConstantPool::print().

virtual void llvm::Pass::releaseMemory  )  [inline, virtual]
 

releaseMemory() - This member can be implemented by a pass if it wants to be able to release its memory when it is no longer needed. The default behavior of passes is to hold onto memory for the entire duration of their lifetime (which is the entire compile time). For pipelined passes, this is not a big deal because that memory gets recycled every time the pass is invoked on another program unit. For IP passes, it is more important to free memory when it is unused.

Optionally implement this function to release pass memory when it is no longer used.

Reimplemented in llvm::DominatorTree, llvm::DominanceFrontierBase, llvm::LoopInfo, llvm::LoopVR, llvm::MemoryDependenceAnalysis, llvm::ScalarEvolution, llvm::LiveIntervals, llvm::LiveStacks, llvm::LiveVariables, llvm::MachineDominatorTree, llvm::MachineLoopInfo, Andersens, BasicCallGraph, llvm::SimpleRegisterCoalescing, and StrongPHIElimination.

Definition at line 151 of file Pass.h.

void llvm::Pass::setResolver AnalysisResolver AR  )  [inline]
 

Definition at line 123 of file Pass.h.

Referenced by llvm::PMDataManager::add(), llvm::PassManagerImpl::addTopLevelPass(), llvm::FunctionPassManagerImpl::addTopLevelPass(), and llvm::FunctionPassManager::FunctionPassManager().

virtual void llvm::Pass::verifyAnalysis  )  const [inline, virtual]
 

verifyAnalysis() - This member can be implemented by a analysis pass to check state of analysis information.

Reimplemented in LoopSimplify.

Definition at line 155 of file Pass.h.

Referenced by llvm::PMDataManager::verifyPreservedAnalysis().


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


This web site is hosted by the Computer Science Department at the University of Illinois at Urbana-Champaign.