LLVM API Documentation
#include <MachineTraceMetrics.h>
Classes | |
class | Ensemble |
struct | FixedBlockInfo |
struct | InstrCycles |
struct | LiveInReg |
class | Trace |
struct | TraceBlockInfo |
Public Types | |
enum | Strategy { TS_MinInstrCount, TS_NumStrategies } |
Strategies for selecting traces. More... | |
Public Member Functions | |
MachineTraceMetrics () | |
void | getAnalysisUsage (AnalysisUsage &) const |
bool | runOnMachineFunction (MachineFunction &) |
void | releaseMemory () |
void | verifyAnalysis () const |
const FixedBlockInfo * | getResources (const MachineBasicBlock *) |
Get the fixed resource information about MBB. Compute it on demand. More... | |
ArrayRef< unsigned > | getProcResourceCycles (unsigned MBBNum) const |
Ensemble * | getEnsemble (Strategy) |
void | invalidate (const MachineBasicBlock *MBB) |
![]() | |
FunctionPass (char &pid) | |
Pass * | createPrinterPass (raw_ostream &O, const std::string &Banner) const |
createPrinterPass - Get a function printer pass. More... | |
virtual void | assignPassManager (PMStack &PMS, PassManagerType T) |
virtual PassManagerType | getPotentialPassManagerType () const |
Return what kind of Pass Manager can manage this pass. More... | |
![]() | |
Pass (PassKind K, char &pid) | |
virtual | ~Pass () |
PassKind | getPassKind () const |
virtual const char * | getPassName () const |
AnalysisID | getPassID () const |
getPassID - Return the PassID number that corresponds to this pass. More... | |
virtual bool | doInitialization (Module &) |
virtual bool | doFinalization (Module &) |
virtual void | print (raw_ostream &O, const Module *M) const |
void | dump () const |
virtual void | preparePassManager (PMStack &) |
Check if available pass managers are suitable for this pass or not. More... | |
void | setResolver (AnalysisResolver *AR) |
AnalysisResolver * | getResolver () const |
virtual void * | getAdjustedAnalysisPointer (AnalysisID ID) |
virtual ImmutablePass * | getAsImmutablePass () |
virtual PMDataManager * | getAsPMDataManager () |
virtual void | dumpPassStructure (unsigned Offset=0) |
template<typename AnalysisType > | |
AnalysisType * | getAnalysisIfAvailable () const |
bool | mustPreserveAnalysisID (char &AID) const |
template<typename AnalysisType > | |
AnalysisType & | getAnalysis () const |
template<typename AnalysisType > | |
AnalysisType & | getAnalysis (Function &F) |
template<typename AnalysisType > | |
AnalysisType & | getAnalysisID (AnalysisID PI) const |
template<typename AnalysisType > | |
AnalysisType & | getAnalysisID (AnalysisID PI, Function &F) |
Static Public Attributes | |
static char | ID = 0 |
Friends | |
class | Ensemble |
class | Trace |
Additional Inherited Members | |
![]() | |
static const PassInfo * | lookupPassInfo (const void *TI) |
static const PassInfo * | lookupPassInfo (StringRef Arg) |
static Pass * | createPass (AnalysisID ID) |
![]() | |
MachineFunctionPass (char &ID) | |
Definition at line 67 of file MachineTraceMetrics.h.
Strategies for selecting traces.
Enumerator | |
---|---|
TS_MinInstrCount |
Select the trace through a block that has the fewest instructions. |
TS_NumStrategies |
Definition at line 334 of file MachineTraceMetrics.h.
Definition at line 39 of file MachineTraceMetrics.cpp.
References llvm::array_endof().
|
virtual |
getAnalysisUsage - Subclasses that override getAnalysisUsage must call this.
For MachineFunctionPasses, calling AU.preservesCFG() indicates that the pass does not modify the MachineBasicBlock CFG.
Reimplemented from llvm::MachineFunctionPass.
Definition at line 44 of file MachineTraceMetrics.cpp.
References llvm::AnalysisUsage::addRequired(), llvm::MachineFunctionPass::getAnalysisUsage(), and llvm::AnalysisUsage::setPreservesAll().
MachineTraceMetrics::Ensemble * MachineTraceMetrics::getEnsemble | ( | MachineTraceMetrics::Strategy | 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 375 of file MachineTraceMetrics.cpp.
References llvm_unreachable, TS_MinInstrCount, and 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 133 of file MachineTraceMetrics.cpp.
References llvm::SmallVectorTemplateCommon< T, typename >::data(), llvm::TargetSchedModel::getNumProcResourceKinds(), and llvm::SmallVectorTemplateCommon< T, typename >::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 84 of file MachineTraceMetrics.cpp.
References llvm::MachineBasicBlock::begin(), llvm::MachineBasicBlock::end(), 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(), I, if(), llvm::MachineTraceMetrics::FixedBlockInfo::InstrCount, llvm::MachineInstr::isCall(), llvm::MachineInstr::isTransient(), llvm::MCSchedClassDesc::isValid(), llvm::A64CC::MI, llvm::TargetSchedModel::resolveSchedClass(), and llvm::PPCISD::SC.
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 388 of file MachineTraceMetrics.cpp.
References llvm::dbgs(), DEBUG, llvm::MachineBasicBlock::getNumber(), llvm::MachineTraceMetrics::Ensemble::invalidate(), and TS_NumStrategies.
|
virtual |
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.
Reimplemented from llvm::Pass.
Definition at line 66 of file MachineTraceMetrics.cpp.
References TS_NumStrategies.
|
virtual |
runOnMachineFunction - This method must be overloaded to perform the desired machine code transformation or analysis.
Implements llvm::MachineFunctionPass.
Definition at line 51 of file MachineTraceMetrics.cpp.
References llvm::TargetMachine::getInstrInfo(), llvm::MachineFunction::getNumBlockIDs(), llvm::TargetSchedModel::getNumProcResourceKinds(), llvm::MachineFunction::getRegInfo(), llvm::TargetMachine::getRegisterInfo(), llvm::TargetMachine::getSubtarget(), llvm::MachineFunction::getTarget(), llvm::TargetSchedModel::init(), Loops, MRI, llvm::SmallVectorImpl< T >::resize(), llvm::A64DB::ST, and TII.
|
virtual |
verifyAnalysis() - This member can be implemented by a analysis pass to check state of analysis information.
Reimplemented from llvm::Pass.
Definition at line 396 of file MachineTraceMetrics.cpp.
References llvm::MachineFunction::getNumBlockIDs(), TS_NumStrategies, and llvm::MachineTraceMetrics::Ensemble::verify().
|
friend |
Definition at line 85 of file MachineTraceMetrics.h.
|
friend |
Definition at line 86 of file MachineTraceMetrics.h.
Referenced by llvm::MachineTraceMetrics::Ensemble::getTrace().
|
static |
Definition at line 77 of file MachineTraceMetrics.h.