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

MachineFunctionPass - This class adapts the FunctionPass interface to allow convenient creation of passes that operate on the MachineFunction representation. More...

#include "llvm/CodeGen/MachineFunctionPass.h"

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

Public Member Functions

bool doInitialization (Module &) override
 doInitialization - Virtual method overridden by subclasses to do any necessary initialization before any pass is run. More...
 
- Public Member Functions inherited from llvm::FunctionPass
 FunctionPass (char &pid)
 
PasscreatePrinterPass (raw_ostream &OS, const std::string &Banner) const override
 createPrinterPass - Get a function printer pass. More...
 
void assignPassManager (PMStack &PMS, PassManagerType T) override
 Find appropriate Function Pass Manager or Call Graph Pass Manager in the PM Stack and add self into that manager. More...
 
PassManagerType getPotentialPassManagerType () const override
 Return what kind of Pass Manager can manage this pass. More...
 
- Public Member Functions inherited from llvm::Pass
 Pass (PassKind K, char &pid)
 
 Pass (const Pass &)=delete
 
Passoperator= (const Pass &)=delete
 
virtual ~Pass ()
 
PassKind getPassKind () const
 
virtual StringRef getPassName () const
 getPassName - Return a nice clean name for a pass. More...
 
AnalysisID getPassID () const
 getPassID - Return the PassID number that corresponds to this pass. More...
 
virtual bool doFinalization (Module &)
 doFinalization - Virtual method overriden by subclasses to do any necessary clean up after all passes have run. More...
 
virtual void print (raw_ostream &OS, const Module *M) const
 print - Print out the internal state of the pass. More...
 
void dump () const
 
virtual void preparePassManager (PMStack &)
 Check if available pass managers are suitable for this pass or not. More...
 
void setResolver (AnalysisResolver *AR)
 
AnalysisResolvergetResolver () const
 
virtual void releaseMemory ()
 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. More...
 
virtual void * getAdjustedAnalysisPointer (AnalysisID ID)
 getAdjustedAnalysisPointer - This method is used when a pass implements an analysis interface through multiple inheritance. More...
 
virtual ImmutablePassgetAsImmutablePass ()
 
virtual PMDataManagergetAsPMDataManager ()
 
virtual void verifyAnalysis () const
 verifyAnalysis() - This member can be implemented by a analysis pass to check state of analysis information. More...
 
virtual void dumpPassStructure (unsigned Offset=0)
 
template<typename AnalysisType >
AnalysisType * getAnalysisIfAvailable () const
 getAnalysisIfAvailable<AnalysisType>() - Subclasses use this function to get analysis information that might be around, for example to update it. More...
 
bool mustPreserveAnalysisID (char &AID) const
 mustPreserveAnalysisID - This method serves the same function as getAnalysisIfAvailable, but works if you just have an AnalysisID. More...
 
template<typename AnalysisType >
AnalysisType & 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. More...
 
template<typename AnalysisType >
AnalysisType & 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. More...
 
template<typename AnalysisType >
AnalysisType & getAnalysisID (AnalysisID PI) const
 
template<typename AnalysisType >
AnalysisType & getAnalysisID (AnalysisID PI, Function &F)
 

Protected Member Functions

 MachineFunctionPass (char &ID)
 
virtual bool runOnMachineFunction (MachineFunction &MF)=0
 runOnMachineFunction - This method must be overloaded to perform the desired machine code transformation or analysis. More...
 
void getAnalysisUsage (AnalysisUsage &AU) const override
 getAnalysisUsage - Subclasses that override getAnalysisUsage must call this. More...
 
virtual MachineFunctionProperties getRequiredProperties () const
 
virtual MachineFunctionProperties getSetProperties () const
 
virtual MachineFunctionProperties getClearedProperties () const
 
- Protected Member Functions inherited from llvm::FunctionPass
bool skipFunction (const Function &F) const
 Optional passes call this function to check whether the pass should be skipped. More...
 

Additional Inherited Members

- Static Public Member Functions inherited from llvm::Pass
static const PassInfolookupPassInfo (const void *TI)
 
static const PassInfolookupPassInfo (StringRef Arg)
 
static PasscreatePass (AnalysisID ID)
 

Detailed Description

MachineFunctionPass - This class adapts the FunctionPass interface to allow convenient creation of passes that operate on the MachineFunction representation.

Instead of overriding runOnFunction, subclasses override runOnMachineFunction.

Definition at line 31 of file MachineFunctionPass.h.

Constructor & Destructor Documentation

◆ MachineFunctionPass()

llvm::MachineFunctionPass::MachineFunctionPass ( char ID)
inlineexplicitprotected

Member Function Documentation

◆ doInitialization()

bool llvm::MachineFunctionPass::doInitialization ( Module )
inlineoverridevirtual

doInitialization - Virtual method overridden by subclasses to do any necessary initialization before any pass is run.

Reimplemented from llvm::Pass.

Reimplemented in llvm::NVPTXAsmPrinter, llvm::X86AsmPrinter, and llvm::SystemZAsmPrinter.

Definition at line 33 of file MachineFunctionPass.h.

References getClearedProperties(), getRequiredProperties(), and getSetProperties().

◆ getAnalysisUsage()

void MachineFunctionPass::getAnalysisUsage ( AnalysisUsage AU) const
overrideprotectedvirtual

getAnalysisUsage - Subclasses that override getAnalysisUsage must call this.

For MachineFunctionPasses, calling AU.preservesCFG() indicates that the pass does not modify the MachineBasicBlock CFG.

Reimplemented from llvm::Pass.

Reimplemented in llvm::SlotIndexes, llvm::NVPTXAsmPrinter, llvm::MachineOptimizationRemarkEmitterPass, llvm::WebAssemblyExceptionInfo, llvm::MachineLoopInfo, llvm::MachineTraceMetrics, llvm::MachineRegionInfoPass, llvm::MachinePipeliner, llvm::MachinePostDominatorTree, llvm::ReachingDefAnalysis, llvm::VirtRegMap, llvm::SelectionDAGISel, llvm::BreakFalseDeps, and llvm::MipsDAGToDAGISel.

Definition at line 104 of file MachineFunctionPass.cpp.

References llvm::AnalysisUsage::addPreserved(), llvm::AnalysisUsage::addRequired(), and llvm::Pass::getAnalysisUsage().

Referenced by BlockData::BlockData(), computeBranchTargetAndInversion(), llvm::createAArch64ConditionalCompares(), llvm::createAArch64ConditionOptimizerPass(), createBBSelectReg(), llvm::createFalkorMarkStridedAccessesPass(), llvm::createGreedyRegisterAllocator(), llvm::createPrologEpilogInserterPass(), llvm::createSystemZLDCleanupPass(), llvm::createX86FlagsCopyLoweringPass(), llvm::InstructionSelect::getAnalysisUsage(), llvm::MachineBlockFrequencyInfo::getAnalysisUsage(), llvm::Legalizer::getAnalysisUsage(), llvm::BreakFalseDeps::getAnalysisUsage(), llvm::LazyMachineBlockFrequencyInfoPass::getAnalysisUsage(), llvm::SelectionDAGISel::getAnalysisUsage(), llvm::Localizer::getAnalysisUsage(), llvm::VirtRegMap::getAnalysisUsage(), llvm::ReachingDefAnalysis::getAnalysisUsage(), llvm::MachinePostDominatorTree::getAnalysisUsage(), llvm::MachinePipeliner::getAnalysisUsage(), llvm::LiveStacks::getAnalysisUsage(), llvm::MachineRegionInfoPass::getAnalysisUsage(), llvm::MachineDominanceFrontier::getAnalysisUsage(), llvm::MachineTraceMetrics::getAnalysisUsage(), llvm::ExecutionDomainFix::getAnalysisUsage(), llvm::MachineLoopInfo::getAnalysisUsage(), llvm::WebAssemblyExceptionInfo::getAnalysisUsage(), llvm::MachineOptimizationRemarkEmitterPass::getAnalysisUsage(), llvm::GISelCSEAnalysisWrapperPass::getAnalysisUsage(), llvm::LiveVariables::getAnalysisUsage(), llvm::AsmPrinter::getAnalysisUsage(), llvm::LiveIntervals::getAnalysisUsage(), llvm::SlotIndexes::getAnalysisUsage(), llvm::IRTranslator::getAnalysisUsage(), llvm::RegBankSelect::getAnalysisUsage(), getLayoutSuccessorProbThreshold(), llvm::X86InstrInfo::getSerializableDirectMachineOperandTargetFlags(), INITIALIZE_PASS(), llvm::CoalescerPair::isCoalescable(), isDebug(), isImplicitlyDef(), isSecondInstructionInSequence(), llvm::LiveRegMatrix::LiveRegMatrix(), MachineFunctionPass(), performSink(), llvm::UnreachableBlockElimPass::run(), and llvm::AntiDepBreaker::~AntiDepBreaker().

◆ getClearedProperties()

virtual MachineFunctionProperties llvm::MachineFunctionPass::getClearedProperties ( ) const
inlineprotectedvirtual

Definition at line 63 of file MachineFunctionPass.h.

References F(), and llvm::RISCVFenceField::O.

Referenced by doInitialization().

◆ getRequiredProperties()

virtual MachineFunctionProperties llvm::MachineFunctionPass::getRequiredProperties ( ) const
inlineprotectedvirtual

◆ getSetProperties()

virtual MachineFunctionProperties llvm::MachineFunctionPass::getSetProperties ( ) const
inlineprotectedvirtual

◆ runOnMachineFunction()

virtual bool llvm::MachineFunctionPass::runOnMachineFunction ( MachineFunction MF)
protectedpure virtual

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