class MachineTraceMetrics

Declaration

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

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.

Declared at: llvm/include/llvm/CodeGen/MachineTraceMetrics.h:87

Inherits from: MachineFunctionPass

Member Variables

private const llvm::MachineFunction* MF = nullptr
private const llvm::TargetInstrInfo* TII = nullptr
private const llvm::TargetRegisterInfo* TRI = nullptr
private const llvm::MachineRegisterInfo* MRI = nullptr
private const llvm::MachineLoopInfo* Loops = nullptr
private llvm::TargetSchedModel SchedModel
private SmallVector< llvm::MachineTraceMetrics::FixedBlockInfo, 4> BlockInfo
private SmallVector<unsigned int, 0> ProcResourceCycles
private llvm::MachineTraceMetrics::Ensemble* [1] Ensembles
public static char ID

Method Overview

Inherited from MachineFunctionPass:

Inherited from FunctionPass:

Inherited from Pass:

Methods

MachineTraceMetrics()

Declared at: llvm/include/llvm/CodeGen/MachineTraceMetrics.h:103

void getAnalysisUsage(llvm::AnalysisUsage&) 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/MachineTraceMetrics.h:105

Parameters

llvm::AnalysisUsage&

unsigned int getCycles(unsigned int Scaled)

Declared at: llvm/include/llvm/CodeGen/MachineTraceMetrics.h:415

Parameters

unsigned int Scaled

llvm::MachineTraceMetrics::Ensemble* getEnsemble(
    llvm::MachineTraceMetrics::Strategy)

Description

Get the trace ensemble representing the given trace selection strategy. The returned Ensemble object is owned by the MachineTraceMetrics analysis, and valid for the lifetime of the analysis pass.

Declared at: llvm/include/llvm/CodeGen/MachineTraceMetrics.h:387

Parameters

llvm::MachineTraceMetrics::Strategy

ArrayRef<unsigned int> getProcResourceCycles(
    unsigned int MBBNum) const

Description

Get the scaled number of cycles used per processor resource in MBB. This is an array with SchedModel.getNumProcResourceKinds() entries. The getResources() function above must have been called first. These numbers have already been scaled by SchedModel.getResourceFactor().

Declared at: llvm/include/llvm/CodeGen/MachineTraceMetrics.h:137

Parameters

unsigned int MBBNum

const llvm::MachineTraceMetrics::FixedBlockInfo*
getResources(const llvm::MachineBasicBlock*)

Description

Get the fixed resource information about MBB. Compute it on demand.

Declared at: llvm/include/llvm/CodeGen/MachineTraceMetrics.h:130

Parameters

const llvm::MachineBasicBlock*

void invalidate(
    const llvm::MachineBasicBlock* MBB)

Description

Invalidate cached information about MBB. This must be called *before* MBB is erased, or the CFG is otherwise changed. This invalidates per-block information about resource usage for MBB only, and it invalidates per-trace information for any trace that passes through MBB. Call Ensemble::getTrace() again to update any trace handles.

Declared at: llvm/include/llvm/CodeGen/MachineTraceMetrics.h:397

Parameters

const llvm::MachineBasicBlock* MBB

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/MachineTraceMetrics.h:107

bool runOnMachineFunction(llvm::MachineFunction&)

Description

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

Declared at: llvm/include/llvm/CodeGen/MachineTraceMetrics.h:106

Parameters

llvm::MachineFunction&

void verifyAnalysis() const

Description

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

Declared at: llvm/include/llvm/CodeGen/MachineTraceMetrics.h:108