LLVM 22.0.0git
llvm::MachineTraceMetrics::Ensemble Class Referenceabstract

A trace ensemble is a collection of traces selected using the same strategy, for example 'minimum resource height'. More...

#include "llvm/CodeGen/MachineTraceMetrics.h"

Public Member Functions

virtual ~Ensemble ()
virtual const chargetName () const =0
void print (raw_ostream &) const
void dump () const
void invalidate (const MachineBasicBlock *MBB)
 Invalidate traces through BadMBB.
void verify () const
Trace getTrace (const MachineBasicBlock *MBB)
 Get the trace that passes through MBB.
void updateDepth (TraceBlockInfo &TBI, const MachineInstr &, SparseSet< LiveRegUnit > &RegUnits)
 Updates the depth of an machine instruction, given RegUnits.
void updateDepth (const MachineBasicBlock *, const MachineInstr &, SparseSet< LiveRegUnit > &RegUnits)
void updateDepths (MachineBasicBlock::iterator Start, MachineBasicBlock::iterator End, SparseSet< LiveRegUnit > &RegUnits)
 Updates the depth of the instructions from Start to End.

Protected Member Functions

 Ensemble (MachineTraceMetrics *)
virtual const MachineBasicBlockpickTracePred (const MachineBasicBlock *)=0
virtual const MachineBasicBlockpickTraceSucc (const MachineBasicBlock *)=0
const MachineLoopgetLoopFor (const MachineBasicBlock *) const
const TraceBlockInfogetDepthResources (const MachineBasicBlock *) const
const TraceBlockInfogetHeightResources (const MachineBasicBlock *) const
ArrayRef< unsignedgetProcResourceDepths (unsigned MBBNum) const
 Get an array of processor resource depths for MBB.
ArrayRef< unsignedgetProcResourceHeights (unsigned MBBNum) const
 Get an array of processor resource heights for MBB.

Protected Attributes

MachineTraceMetricsMTM

Friends

class Trace

Detailed Description

A trace ensemble is a collection of traces selected using the same strategy, for example 'minimum resource height'.

There is one trace for every block in the function.

Definition at line 339 of file MachineTraceMetrics.h.

Constructor & Destructor Documentation

◆ Ensemble()

MachineTraceMetrics::Ensemble::Ensemble ( MachineTraceMetrics * ct)
explicitprotected

◆ ~Ensemble()

MachineTraceMetrics::Ensemble::~Ensemble ( )
virtualdefault

Member Function Documentation

◆ dump()

void llvm::MachineTraceMetrics::Ensemble::dump ( ) const
inline

Definition at line 374 of file MachineTraceMetrics.h.

References llvm::dbgs(), and print().

◆ getDepthResources()

const MachineTraceMetrics::TraceBlockInfo * MachineTraceMetrics::Ensemble::getDepthResources ( const MachineBasicBlock * MBB) const
protected

◆ getHeightResources()

const MachineTraceMetrics::TraceBlockInfo * MachineTraceMetrics::Ensemble::getHeightResources ( const MachineBasicBlock * MBB) const
protected

◆ getLoopFor()

const MachineLoop * MachineTraceMetrics::Ensemble::getLoopFor ( const MachineBasicBlock * MBB) const
protected

Definition at line 182 of file MachineTraceMetrics.cpp.

References MBB, and MTM.

Referenced by verify().

◆ getName()

virtual const char * llvm::MachineTraceMetrics::Ensemble::getName ( ) const
pure virtual

◆ getProcResourceDepths()

ArrayRef< unsigned > MachineTraceMetrics::Ensemble::getProcResourceDepths ( unsigned MBBNum) const
protected

Get an array of processor resource depths for MBB.

Indexed by processor resource kind, this array contains the scaled processor resources consumed by all blocks preceding MBB in its trace. It does not include instructions in MBB.

Compare TraceBlockInfo::InstrDepth.

Definition at line 277 of file MachineTraceMetrics.cpp.

References llvm::ArrayRef(), assert(), and MTM.

◆ getProcResourceHeights()

ArrayRef< unsigned > MachineTraceMetrics::Ensemble::getProcResourceHeights ( unsigned MBBNum) const
protected

Get an array of processor resource heights for MBB.

Indexed by processor resource kind, this array contains the scaled processor resources consumed by this block and all blocks following it in its trace.

Compare TraceBlockInfo::InstrHeight.

Definition at line 290 of file MachineTraceMetrics.cpp.

References llvm::ArrayRef(), assert(), and MTM.

◆ getTrace()

◆ invalidate()

◆ pickTracePred()

virtual const MachineBasicBlock * llvm::MachineTraceMetrics::Ensemble::pickTracePred ( const MachineBasicBlock * )
protectedpure virtual

◆ pickTraceSucc()

virtual const MachineBasicBlock * llvm::MachineTraceMetrics::Ensemble::pickTraceSucc ( const MachineBasicBlock * )
protectedpure virtual

◆ print()

void MachineTraceMetrics::Ensemble::print ( raw_ostream & OS) const

Definition at line 1321 of file MachineTraceMetrics.cpp.

References getName().

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

◆ updateDepth() [1/2]

void MachineTraceMetrics::Ensemble::updateDepth ( const MachineBasicBlock * MBB,
const MachineInstr & UseMI,
SparseSet< LiveRegUnit > & RegUnits )

Definition at line 861 of file MachineTraceMetrics.cpp.

References MBB, updateDepth(), and UseMI.

◆ updateDepth() [2/2]

◆ updateDepths()

void MachineTraceMetrics::Ensemble::updateDepths ( MachineBasicBlock::iterator Start,
MachineBasicBlock::iterator End,
SparseSet< LiveRegUnit > & RegUnits )

Updates the depth of the instructions from Start to End.

Definition at line 867 of file MachineTraceMetrics.cpp.

References updateDepth().

◆ verify()

◆ Trace

friend class Trace
friend

Definition at line 340 of file MachineTraceMetrics.h.

References DefMI, and Trace.

Referenced by getTrace(), and Trace.

Member Data Documentation

◆ MTM

MachineTraceMetrics& llvm::MachineTraceMetrics::Ensemble::MTM
protected

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