class LazyMachineBlockFrequencyInfoPass

Declaration

class LazyMachineBlockFrequencyInfoPass : public MachineFunctionPass { /* full declaration omitted */ };

Description

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. This works by checking querying if MBFI is available and otherwise generating MBFI on the fly. In this case the passes required for (LI, DT) are also queried before being computed on the fly. Note that it is expected that we wouldn't need this functionality for the new PM since with the new PM, analyses are executed on demand.

Declared at: llvm/include/llvm/CodeGen/LazyMachineBlockFrequencyInfo.h:37

Inherits from: MachineFunctionPass

Member Variables

private std::unique_ptr<MachineBlockFrequencyInfo> OwnedMBFI
If generated on the fly this own the instance.
private std::unique_ptr<MachineLoopInfo> OwnedMLI
If generated on the fly this own the instance.
private std::unique_ptr<MachineDominatorTree> OwnedMDT
If generated on the fly this own the instance.
private llvm::MachineFunction* MF = nullptr
The function.
public static char ID

Method Overview

Inherited from MachineFunctionPass:

Inherited from FunctionPass:

Inherited from Pass:

Methods

LazyMachineBlockFrequencyInfoPass()

Declared at: llvm/include/llvm/CodeGen/LazyMachineBlockFrequencyInfo.h:58

llvm::MachineBlockFrequencyInfo&
calculateIfNotAvailable() const

Description

Calculate MBFI and all other analyses that's not available and required by BFI.

Declared at: llvm/include/llvm/CodeGen/LazyMachineBlockFrequencyInfo.h:53

void getAnalysisUsage(
    llvm::AnalysisUsage& AU) const

Description

getAnalysisUsage - Subclasses that override getAnalysisUsage must call this. For MachineFunctionPasses, calling AU.preservesCFG() indicates that the pass does not modify the MachineBasicBlock CFG.

Declared at: llvm/include/llvm/CodeGen/LazyMachineBlockFrequencyInfo.h:68

Parameters

llvm::AnalysisUsage& AU

llvm::MachineBlockFrequencyInfo& getBFI()

Description

Compute and return the block frequencies.

Declared at: llvm/include/llvm/CodeGen/LazyMachineBlockFrequencyInfo.h:61

const llvm::MachineBlockFrequencyInfo& getBFI()
    const

Description

Compute and return the block frequencies.

Declared at: llvm/include/llvm/CodeGen/LazyMachineBlockFrequencyInfo.h:64

void print(llvm::raw_ostream& OS,
           const llvm::Module* M) const

Description

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.

Declared at: llvm/include/llvm/CodeGen/LazyMachineBlockFrequencyInfo.h:72

Parameters

llvm::raw_ostream& OS
const llvm::Module* M

void releaseMemory()

Description

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.

Declared at: llvm/include/llvm/CodeGen/LazyMachineBlockFrequencyInfo.h:71

bool runOnMachineFunction(
    llvm::MachineFunction& F)

Description

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

Declared at: llvm/include/llvm/CodeGen/LazyMachineBlockFrequencyInfo.h:70

Parameters

llvm::MachineFunction& F