LLVM
8.0.1
|
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 | invalidate (const MachineBasicBlock *MBB) |
Invalidate traces through BadMBB. More... | |
void | verify () const |
Trace | getTrace (const MachineBasicBlock *MBB) |
Get the trace that passes through MBB. More... | |
void | updateDepth (TraceBlockInfo &TBI, const MachineInstr &, SparseSet< LiveRegUnit > &RegUnits) |
Updates the depth of an machine instruction, given RegUnits. More... | |
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. More... | |
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. More... | |
ArrayRef< unsigned > | getProcResourceHeights (unsigned MBBNum) const |
Get an array of processor resource heights for MBB. More... | |
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 322 of file MachineTraceMetrics.h.
|
explicitprotected |
Definition at line 157 of file MachineTraceMetrics.cpp.
References llvm::TargetSchedModel::getNumProcResourceKinds(), MTM, llvm::SmallVectorImpl< T >::resize(), and ~Ensemble().
|
virtualdefault |
Referenced by Ensemble().
|
protected |
Definition at line 243 of file MachineTraceMetrics.cpp.
References getHeightResources(), llvm::MachineBasicBlock::getNumber(), and llvm::MachineTraceMetrics::TraceBlockInfo::hasValidDepth().
Referenced by getLoopFor(), and isExitingLoop().
|
protected |
Definition at line 252 of file MachineTraceMetrics.cpp.
References llvm::MachineBasicBlock::getNumber(), getProcResourceDepths(), and llvm::MachineTraceMetrics::TraceBlockInfo::hasValidHeight().
Referenced by getDepthResources(), and isExitingLoop().
|
protected |
Definition at line 169 of file MachineTraceMetrics.cpp.
References assert(), llvm::SmallVectorTemplateCommon< T, typename >::begin(), llvm::copy(), getDepthResources(), llvm::MachineLoopInfo::getLoopFor(), llvm::MachineBasicBlock::getNumber(), llvm::TargetSchedModel::getNumProcResourceKinds(), llvm::MachineTraceMetrics::getProcResourceCycles(), getProcResourceDepths(), getProcResourceHeights(), llvm::MachineTraceMetrics::getResources(), llvm::MachineTraceMetrics::TraceBlockInfo::hasValidDepth(), llvm::MachineTraceMetrics::TraceBlockInfo::hasValidHeight(), llvm::MachineTraceMetrics::TraceBlockInfo::Head, llvm::MachineTraceMetrics::FixedBlockInfo::InstrCount, llvm::MachineTraceMetrics::TraceBlockInfo::InstrDepth, llvm::MachineTraceMetrics::TraceBlockInfo::InstrHeight, MTM, llvm::MachineTraceMetrics::TraceBlockInfo::Pred, llvm::MachineTraceMetrics::TraceBlockInfo::Succ, and llvm::MachineTraceMetrics::TraceBlockInfo::Tail.
Referenced by isExitingLoop(), pushDepHeight(), and verify().
Referenced by llvm::po_iterator_storage< LoopBounds, true >::insertEdge(), invalidate(), isExitingLoop(), and print().
|
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 265 of file MachineTraceMetrics.cpp.
References assert(), llvm::SmallVectorTemplateCommon< T, typename >::data(), llvm::TargetSchedModel::getNumProcResourceKinds(), getProcResourceHeights(), llvm::makeArrayRef(), MTM, and llvm::SmallVectorBase::size().
Referenced by getHeightResources(), and getLoopFor().
|
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 278 of file MachineTraceMetrics.cpp.
References assert(), llvm::SmallVectorTemplateCommon< T, typename >::data(), llvm::TargetSchedModel::getNumProcResourceKinds(), llvm::makeArrayRef(), MTM, and llvm::SmallVectorBase::size().
Referenced by getLoopFor(), getProcResourceDepths(), and pushDepHeight().
MachineTraceMetrics::Trace MachineTraceMetrics::Ensemble::getTrace | ( | const MachineBasicBlock * | MBB | ) |
Get the trace that passes through MBB.
The trace is computed on demand.
Definition at line 1160 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 Trace.
void MachineTraceMetrics::Ensemble::invalidate | ( | const MachineBasicBlock * | MBB | ) |
Invalidate traces through BadMBB.
Definition at line 523 of file MachineTraceMetrics.cpp.
References assert(), llvm::dbgs(), llvm::SmallVectorBase::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, llvm::SmallVectorImpl< T >::pop_back_val(), llvm::MachineTraceMetrics::TraceBlockInfo::Pred, llvm::MachineBasicBlock::predecessors(), llvm::printMBBReference(), llvm::SmallVectorTemplateBase< T >::push_back(), llvm::MachineTraceMetrics::TraceBlockInfo::Succ, and llvm::MachineBasicBlock::successors().
Referenced by insertDeleteInstructions().
|
protectedpure virtual |
Referenced by llvm::po_iterator_storage< LoopBounds, true >::insertEdge(), and isExitingLoop().
|
protectedpure virtual |
Referenced by llvm::po_iterator_storage< LoopBounds, true >::insertEdge(), and isExitingLoop().
void MachineTraceMetrics::Ensemble::print | ( | raw_ostream & | OS | ) | const |
Definition at line 1289 of file MachineTraceMetrics.cpp.
References getName().
Referenced by llvm::operator<<().
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 783 of file MachineTraceMetrics.cpp.
References assert(), llvm::TargetSchedModel::computeOperandLatency(), 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::MachineInstr::isPHI(), llvm::MachineTraceMetrics::TraceBlockInfo::isUsefulDominator(), LLVM_DEBUG, llvm::max(), MTM, llvm::MachineTraceMetrics::TraceBlockInfo::Pred, updatePhysDepsDownwards(), and UseMI.
Referenced by insertDeleteInstructions(), updateDepth(), and updatePhysDepsDownwards().
void MachineTraceMetrics::Ensemble::updateDepth | ( | const MachineBasicBlock * | MBB, |
const MachineInstr & | UseMI, | ||
SparseSet< LiveRegUnit > & | RegUnits | ||
) |
Definition at line 822 of file MachineTraceMetrics.cpp.
References llvm::MachineBasicBlock::getNumber(), updateDepth(), updateDepths(), and UseMI.
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 828 of file MachineTraceMetrics.cpp.
Referenced by updateDepth().
void MachineTraceMetrics::Ensemble::verify | ( | ) | const |
Definition at line 586 of file MachineTraceMetrics.cpp.
References assert(), llvm::MachineRegisterInfo::defusechain_iterator< ReturnUses, ReturnDefs, SkipDebug, ByOperand, ByInstr, ByBundle >::atEnd(), llvm::MachineRegisterInfo::def_begin(), DefMI, llvm::MachineFunction::getBlockNumbered(), getLoopFor(), llvm::MachineBasicBlock::getNumber(), llvm::MachineFunction::getNumBlockIDs(), llvm::MachineRegisterInfo::defusechain_iterator< ReturnUses, ReturnDefs, SkipDebug, ByOperand, ByInstr, ByBundle >::getOperandNo(), llvm::MachineOperand::getParent(), llvm::MachineTraceMetrics::TraceBlockInfo::hasValidDepth(), llvm::MachineTraceMetrics::TraceBlockInfo::hasValidHeight(), llvm::MachineBasicBlock::isPredecessor(), llvm::MachineBasicBlock::isSuccessor(), llvm::TargetRegisterInfo::isVirtualRegister(), MRI, MTM, llvm::MachineTraceMetrics::TraceBlockInfo::Pred, and llvm::MachineTraceMetrics::TraceBlockInfo::Succ.
|
friend |
Definition at line 323 of file MachineTraceMetrics.h.
Referenced by getTrace().
|
protected |
Definition at line 340 of file MachineTraceMetrics.h.
Referenced by Ensemble(), getLoopFor(), getProcResourceDepths(), getProcResourceHeights(), llvm::po_iterator_storage< LoopBounds, true >::insertEdge(), isExitingLoop(), pushDepHeight(), updateDepth(), updatePhysDepsDownwards(), and verify().