LLVM 20.0.0git
|
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 char * | getName () 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 MachineBasicBlock * | pickTracePred (const MachineBasicBlock *)=0 |
virtual const MachineBasicBlock * | pickTraceSucc (const MachineBasicBlock *)=0 |
const MachineLoop * | getLoopFor (const MachineBasicBlock *) const |
const TraceBlockInfo * | getDepthResources (const MachineBasicBlock *) const |
const TraceBlockInfo * | getHeightResources (const MachineBasicBlock *) const |
ArrayRef< unsigned > | getProcResourceDepths (unsigned MBBNum) const |
Get an array of processor resource depths for MBB. | |
ArrayRef< unsigned > | getProcResourceHeights (unsigned MBBNum) const |
Get an array of processor resource heights for MBB. | |
Protected Attributes | |
MachineTraceMetrics & | MTM |
Friends | |
class | Trace |
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 332 of file MachineTraceMetrics.h.
|
explicitprotected |
Definition at line 156 of file MachineTraceMetrics.cpp.
References llvm::TargetSchedModel::getNumProcResourceKinds(), MTM, and llvm::SmallVectorImpl< T >::resize().
|
virtualdefault |
|
inline |
Definition at line 367 of file MachineTraceMetrics.h.
References llvm::dbgs(), and print().
|
protected |
Definition at line 241 of file MachineTraceMetrics.cpp.
References llvm::MachineBasicBlock::getNumber(), llvm::MachineTraceMetrics::TraceBlockInfo::hasValidDepth(), and MBB.
|
protected |
Definition at line 250 of file MachineTraceMetrics.cpp.
References llvm::MachineBasicBlock::getNumber(), llvm::MachineTraceMetrics::TraceBlockInfo::hasValidHeight(), and MBB.
|
protected |
Definition at line 168 of file MachineTraceMetrics.cpp.
References MBB.
|
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 263 of file MachineTraceMetrics.cpp.
References assert().
|
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 276 of file MachineTraceMetrics.cpp.
References assert().
MachineTraceMetrics::Trace MachineTraceMetrics::Ensemble::getTrace | ( | const MachineBasicBlock * | MBB | ) |
Get the trace that passes through MBB.
The trace is computed on demand.
Definition at line 1164 of file MachineTraceMetrics.cpp.
References llvm::MachineBasicBlock::getNumber(), llvm::MachineTraceMetrics::TraceBlockInfo::hasValidDepth(), llvm::MachineTraceMetrics::TraceBlockInfo::hasValidHeight(), llvm::MachineTraceMetrics::TraceBlockInfo::HasValidInstrDepths, llvm::MachineTraceMetrics::TraceBlockInfo::HasValidInstrHeights, and MBB.
void MachineTraceMetrics::Ensemble::invalidate | ( | const MachineBasicBlock * | MBB | ) |
Invalidate traces through BadMBB.
Definition at line 541 of file MachineTraceMetrics.cpp.
References assert(), llvm::dbgs(), llvm::SmallVectorBase< Size_T >::empty(), getName(), llvm::MachineBasicBlock::getNumber(), llvm::MachineTraceMetrics::TraceBlockInfo::hasValidDepth(), llvm::MachineTraceMetrics::TraceBlockInfo::hasValidHeight(), I, llvm::MachineTraceMetrics::TraceBlockInfo::invalidateDepth(), llvm::MachineTraceMetrics::TraceBlockInfo::invalidateHeight(), llvm::MachineBasicBlock::isPredecessor(), llvm::MachineBasicBlock::isSuccessor(), LLVM_DEBUG, MBB, llvm::SmallVectorImpl< T >::pop_back_val(), llvm::MachineTraceMetrics::TraceBlockInfo::Pred, llvm::MachineBasicBlock::predecessors(), llvm::printMBBReference(), llvm::SmallVectorTemplateBase< T, bool >::push_back(), llvm::MachineTraceMetrics::TraceBlockInfo::Succ, and llvm::MachineBasicBlock::successors().
Referenced by insertDeleteInstructions().
|
protectedpure virtual |
|
protectedpure virtual |
void MachineTraceMetrics::Ensemble::print | ( | raw_ostream & | OS | ) | const |
Definition at line 1293 of file MachineTraceMetrics.cpp.
Referenced by dump(), and llvm::operator<<().
void MachineTraceMetrics::Ensemble::updateDepth | ( | const MachineBasicBlock * | MBB, |
const MachineInstr & | UseMI, | ||
SparseSet< LiveRegUnit > & | RegUnits | ||
) |
Definition at line 833 of file MachineTraceMetrics.cpp.
References llvm::MachineBasicBlock::getNumber(), MBB, and UseMI.
void MachineTraceMetrics::Ensemble::updateDepth | ( | MachineTraceMetrics::TraceBlockInfo & | TBI, |
const MachineInstr & | UseMI, | ||
SparseSet< LiveRegUnit > & | RegUnits | ||
) |
Updates the depth of an machine instruction, given RegUnits.
Definition at line 794 of file MachineTraceMetrics.cpp.
References assert(), llvm::MachineTraceMetrics::TraceBlockInfo::CriticalPath, llvm::dbgs(), llvm::MachineTraceMetrics::InstrCycles::Depth, getDataDeps(), getPHIDeps(), llvm::MachineTraceMetrics::TraceBlockInfo::HasValidInstrDepths, llvm::MachineTraceMetrics::TraceBlockInfo::HasValidInstrHeights, llvm::MachineTraceMetrics::InstrCycles::Height, llvm::MachineTraceMetrics::TraceBlockInfo::isUsefulDominator(), LLVM_DEBUG, llvm::MachineTraceMetrics::TraceBlockInfo::Pred, updatePhysDepsDownwards(), and UseMI.
Referenced by insertDeleteInstructions().
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 839 of file MachineTraceMetrics.cpp.
References End.
void MachineTraceMetrics::Ensemble::verify | ( | ) | const |
Definition at line 604 of file MachineTraceMetrics.cpp.
References assert(), llvm::LoopBase< BlockT, LoopT >::getHeader(), llvm::MachineBasicBlock::getNumber(), llvm::MachineTraceMetrics::TraceBlockInfo::hasValidDepth(), llvm::MachineTraceMetrics::TraceBlockInfo::hasValidHeight(), llvm::MachineBasicBlock::isPredecessor(), llvm::MachineBasicBlock::isSuccessor(), MBB, llvm::MachineTraceMetrics::TraceBlockInfo::Pred, and llvm::MachineTraceMetrics::TraceBlockInfo::Succ.
|
friend |
Definition at line 333 of file MachineTraceMetrics.h.
|
protected |
Definition at line 350 of file MachineTraceMetrics.h.
Referenced by Ensemble().