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.

Synopsis

Declared in <llvm/CodeGen/MachineFunctionPass.h>

class MachineFunctionPass
    : public FunctionPass

Base Classes

Name

Description

FunctionPass

FunctionPass class ‐ This class is used to implement most global optimizations. Optimizations should subclass this class if they meet the following constraints:

Member Functions

Name

Description

operator= [deleted]

Copy assignment operator

assignPassManager

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

createPrinterPass [virtual]

createPrinterPass ‐ Get a function printer pass.

doFinalization [virtual]

doFinalization ‐ Virtual method overriden by subclasses to do any necessary clean up after all passes have run.

doInitialization [virtual]

dump

dumpPassStructure [virtual]

getAnalysis

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

getAnalysisID

getAnalysisIfAvailable

getAnalysisIfAvailable<AnalysisType>() ‐ Subclasses use this function to get analysis information that might be around, for example to update it. This is different than getAnalysis in that it can fail (if the analysis results haven't been computed), so should only be used if you can handle the case when the analysis is not available. This method is often used by transformation APIs to update analysis results for a pass automatically as the transform is performed.

getAnalysisUsage [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.

getAsImmutablePass [virtual]

getAsPMDataManager [virtual]

getPassArgument

Return a nice clean name for a pass corresponding to that used to enable the pass in opt.

getPassID

getPassID ‐ Return the PassID number that corresponds to this pass.

getPassKind

getPassName [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.

getPotentialPassManagerType [virtual]

Return what kind of Pass Manager can manage this pass.

getResolver

mustPreserveAnalysisID

mustPreserveAnalysisID ‐ This method serves the same function as getAnalysisIfAvailable, 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 getAnalysisIfAvailable if you do), but it can tell you if you need to preserve the pass at least.

preparePassManager [virtual]

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

print [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.

printIRUnit [virtual]

For ‐‐print‐changed, serialize the IR unit this pass operates on. The default prints F; MachineFunctionPass prints its MachineFunction. Returns false if there is nothing to report.

releaseMemory [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.

runOnFunction [virtual]

runOnFunction ‐ Virtual method overriden by subclasses to do the per‐function processing of the pass.

setResolver

verifyAnalysis [virtual]

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

Static Member Functions

Protected Member Functions

Name

Description

MachineFunctionPass [constructor]

Construct from char

getAnalysisUsage [virtual]

getAnalysisUsage ‐ Subclasses that override getAnalysisUsage must call this.

getClearedProperties [virtual]

getRequiredProperties [virtual]

getSetProperties [virtual]

runOnMachineFunction [virtual]

runOnMachineFunction ‐ This method must be overloaded to perform the desired machine code transformation or analysis.

skipFunction

Optional passes call this function to check whether the pass should be skipped. This is the case when Attribute::OptimizeNone is set or when optimization bisect is over the limit.

Non-Member Functions

Name

Description

createBasicBlockMatchingAndInferencePass

createBasicBlockMatchingAndInferencePass ‐ This pass enables matching and inference when using propeller.

createBasicBlockSectionsPass

createBasicBlockSections Pass ‐ This pass assigns sections to machine basic blocks and is enabled with ‐fbasic‐block‐sections.

createGCEmptyBasicBlocksLegacyPass

createGCEmptyBasicblocksPass ‐ Empty basic blocks (basic blocks without real code) appear as the result of optimization passes removing instructions. These blocks confuscate profile analysis (e.g., basic block sections) since they will share the address of their fallthrough blocks. This pass garbage‐collects such basic blocks.

createInsertCodePrefetchPass

createInsertCodePrefetchPass ‐ This pass enables inserting code prefetch hints based on the basic block section profile.

createMIR2VecPrinterLegacyPass

MIR2VecPrinter pass ‐ This pass prints out the MIR2Vec embeddings for machine functions, basic blocks and instructions.

createMIR2VecVocabPrinterLegacyPass

MIR2VecVocabPrinter pass ‐ This pass prints out the MIR2Vec vocabulary contents to the given stream as a debugging tool.

createMachineBlockHashInfoPass

createMachineBlockHashInfoPass ‐ This pass computes basic block hashes.

createMachineFunctionPrinterPass

MachineFunctionPrinter pass ‐ This pass prints out the machine function to the given stream as a debugging tool.

createMachineFunctionSplitterPass

createMachineFunctionSplitterPass ‐ This pass splits machine functions using profile information.

createPrintMIRPass

MIRPrinting pass ‐ this pass prints out the LLVM IR into the given stream using the MIR serialization format.

createResetMachineFunctionPass

This pass resets a MachineFunction when it has the FailedISel property as if it was just created. If EmitFallbackDiag is true, the pass will emit a DiagnosticInfoISelFallback for every MachineFunction it resets. If AbortOnFailedISel is true, abort compilation instead of resetting.

createStackFrameLayoutAnalysisPass

StackFramePrinter pass ‐ This pass prints out the machine function's stack frame to the given stream as a debugging tool.

createStaticDataSplitterLegacyPass

createStaticDataSplitterPass ‐ This is a machine‐function pass that categorizes static data hotness using profile information.

getPassTimer

Request the timer for this legacy‐pass‐manager's pass instance.

isBitcodeWriterPass

Check whether a pass is a BitcodeWriterPass.

isIRPrintingPass

Return true if a pass is for IR printing.

Derived Classes

Name

Description

AsmPrinter

This class is intended to be used as a driving class for all asm writers.

BasicBlockMatchingAndInference

CFIFixupLegacy

EdgeBundlesWrapperLegacy

ExecutionDomainFix

GISelCSEAnalysisWrapperPass

The actual analysis pass wrapper.

GISelValueTrackingAnalysisLegacy

Eventually add other features such as caching/ser/deserializing to MIR etc. Those implementations can derive from GISelValueTracking and override computeKnownBitsImpl.

IRTranslatorLegacy

InstructionSelectLegacy

This pass is responsible for selecting generic machine instructions to target‐specific instructions. It relies on the InstructionSelector provided by the target. Selection is done by examining blocks in post‐order, and instructions in reverse order.

LazyMachineBlockFrequencyInfoPass

This is an alternative analysis pass to MachineBlockFrequencyInfo. The difference is that with this pass, the block frequencies are not computed when the analysis pass is executed but rather when the BFI result is explicitly requested by the analysis client.

LegalizerLegacy

LiveDebugVariablesWrapperLegacy

LiveIntervalsWrapperPass

LiveRegMatrixWrapperLegacy

LiveStacksWrapperLegacy

LiveVariablesWrapperPass

LoadStoreOptLegacy

LocalizerLegacy

This pass implements the localization mechanism described at the top of this file. One specificity of the implementation is that it will materialize one and only one instance of a constant per basic block, thus enabling reuse of that constant within that block. Moreover, it only materializes constants in blocks where they are used. PHI uses are considered happening at the end of the related predecessor.

MIR2VecPrinterLegacyPass

This pass prints the MIR2Vec embeddings for machine functions, basic blocks, and instructions

MIR2VecVocabPrinterLegacyPass

This pass prints the embeddings in the MIR2Vec vocabulary

MIRAddFSDiscriminators

MIRProfileLoaderPass

MachineBlockFrequencyInfoWrapperPass

MachineBlockHashInfo

Legacy MachineFunctionPass for MachineBlockHashInfo.

MachineCycleInfoWrapperPass

Legacy analysis pass which computes a MachineCycleInfo.

MachineDominanceFrontierWrapperPass

MachineDominatorTreeWrapperPass

Analysis pass which computes a MachineDominatorTree.

MachineLoopInfoWrapperPass

MachineOptimizationRemarkEmitterPass

The analysis pass

MachinePipeliner

The main class in the implementation of the target independent software pipeliner pass.

MachinePostDominatorTreeWrapperPass

MachineRegionInfoPass

MachineRegisterClassInfoWrapperPass

MachineTraceMetricsWrapperPass

MachineUniformityAnalysisPass

Legacy analysis pass which computes a MachineUniformityInfo.

ReachingDefInfoWrapperPass

RegBankSelectLegacy

This pass implements the reg bank selector pass used in the GlobalISel pipeline. At the end of this pass, all register operands have been assigned

SelectionDAGISelLegacy

SlotIndexesWrapperPass

SpillPlacementWrapperLegacy

ThunkInserterPass

Basic implementation of MachineFunctionPass wrapping one or more `ThunkInserter`s passed as type parameters.

VirtRegMapWrapperLegacy

Created with MrDocs