LLVM 20.0.0git
|
#include "llvm/CodeGen/MachineTraceMetrics.h"
Classes | |
class | Ensemble |
A trace ensemble is a collection of traces selected using the same strategy, for example 'minimum resource height'. More... | |
struct | FixedBlockInfo |
Per-basic block information that doesn't depend on the trace through the block. More... | |
struct | InstrCycles |
InstrCycles represents the cycle height and depth of an instruction in a trace. More... | |
struct | LiveInReg |
A virtual register or regunit required by a basic block or its trace successors. More... | |
class | Trace |
A trace represents a plausible sequence of executed basic blocks that passes through the current basic block one. More... | |
struct | TraceBlockInfo |
Per-basic block information that relates to a specific trace through the block. More... | |
Public Member Functions | |
MachineTraceMetrics ()=default | |
MachineTraceMetrics (MachineFunction &MF, const MachineLoopInfo &LI) | |
MachineTraceMetrics (MachineTraceMetrics &&)=default | |
~MachineTraceMetrics () | |
void | init (MachineFunction &Func, const MachineLoopInfo &LI) |
void | clear () |
const FixedBlockInfo * | getResources (const MachineBasicBlock *) |
Get the fixed resource information about MBB. Compute it on demand. | |
ArrayRef< unsigned > | getProcReleaseAtCycles (unsigned MBBNum) const |
Get the scaled number of cycles used per processor resource in MBB. | |
Ensemble * | getEnsemble (MachineTraceStrategy) |
Get the trace ensemble representing the given trace selection strategy. | |
void | invalidate (const MachineBasicBlock *MBB) |
Invalidate cached information about MBB. | |
bool | invalidate (MachineFunction &, const PreservedAnalyses &PA, MachineFunctionAnalysisManager::Invalidator &) |
Handle invalidation explicitly. | |
void | verifyAnalysis () const |
Friends | |
class | MachineTraceMetricsWrapperPass |
class | Ensemble |
class | Trace |
Definition at line 97 of file MachineTraceMetrics.h.
|
default |
|
inlineexplicit |
Definition at line 115 of file MachineTraceMetrics.h.
References init().
|
default |
MachineTraceMetrics::~MachineTraceMetrics | ( | ) |
Definition at line 93 of file MachineTraceMetrics.cpp.
References clear().
void MachineTraceMetrics::clear | ( | ) |
Definition at line 95 of file MachineTraceMetrics.cpp.
Referenced by llvm::MachineTraceMetricsWrapperPass::releaseMemory(), and ~MachineTraceMetrics().
MachineTraceMetrics::Ensemble * MachineTraceMetrics::getEnsemble | ( | MachineTraceStrategy | strategy | ) |
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.
Definition at line 412 of file MachineTraceMetrics.cpp.
References assert(), llvm_unreachable, llvm::TS_Local, llvm::TS_MinInstrCount, and llvm::TS_NumStrategies.
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().
Definition at line 158 of file MachineTraceMetrics.cpp.
References assert(), llvm::SmallVectorTemplateCommon< T, typename >::data(), llvm::TargetSchedModel::getNumProcResourceKinds(), and llvm::SmallVectorBase< Size_T >::size().
const MachineTraceMetrics::FixedBlockInfo * MachineTraceMetrics::getResources | ( | const MachineBasicBlock * | MBB | ) |
Get the fixed resource information about MBB. Compute it on demand.
Compute the resource usage in basic block MBB.
Definition at line 111 of file MachineTraceMetrics.cpp.
References assert(), llvm::MachineBasicBlock::getNumber(), llvm::TargetSchedModel::getNumProcResourceKinds(), llvm::TargetSchedModel::getResourceFactor(), llvm::TargetSchedModel::getWriteProcResBegin(), llvm::TargetSchedModel::getWriteProcResEnd(), llvm::MachineTraceMetrics::FixedBlockInfo::HasCalls, llvm::TargetSchedModel::hasInstrSchedModel(), llvm::MachineTraceMetrics::FixedBlockInfo::hasResources(), llvm::MachineTraceMetrics::FixedBlockInfo::InstrCount, InstrCount, MBB, MI, and llvm::TargetSchedModel::resolveSchedClass().
void MachineTraceMetrics::init | ( | MachineFunction & | Func, |
const MachineLoopInfo & | LI | ||
) |
Definition at line 74 of file MachineTraceMetrics.cpp.
References llvm::MachineFunction::getNumBlockIDs(), llvm::TargetSchedModel::getNumProcResourceKinds(), llvm::MachineFunction::getRegInfo(), llvm::MachineFunction::getSubtarget(), llvm::TargetSchedModel::init(), and llvm::SmallVectorImpl< T >::resize().
Referenced by MachineTraceMetrics(), and llvm::MachineTraceMetricsWrapperPass::runOnMachineFunction().
void MachineTraceMetrics::invalidate | ( | const MachineBasicBlock * | MBB | ) |
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.
Definition at line 433 of file MachineTraceMetrics.cpp.
References llvm::dbgs(), llvm::MachineBasicBlock::getNumber(), LLVM_DEBUG, MBB, and llvm::printMBBReference().
bool MachineTraceMetrics::invalidate | ( | MachineFunction & | , |
const PreservedAnalyses & | PA, | ||
MachineFunctionAnalysisManager::Invalidator & | |||
) |
Handle invalidation explicitly.
Definition at line 442 of file MachineTraceMetrics.cpp.
References llvm::PreservedAnalyses::getChecker().
void MachineTraceMetrics::verifyAnalysis | ( | ) | const |
Definition at line 453 of file MachineTraceMetrics.cpp.
References assert(), and llvm::MachineFunction::getNumBlockIDs().
Referenced by llvm::MachineTraceMetricsWrapperPass::verifyAnalysis().
|
friend |
Definition at line 107 of file MachineTraceMetrics.h.
|
friend |
Definition at line 106 of file MachineTraceMetrics.h.
|
friend |
Definition at line 108 of file MachineTraceMetrics.h.