LLVM API Documentation

Classes | Public Types | Public Member Functions | Static Public Attributes | Friends
llvm::MachineTraceMetrics Class Reference

#include <MachineTraceMetrics.h>

Inheritance diagram for llvm::MachineTraceMetrics:
Inheritance graph
[legend]
Collaboration diagram for llvm::MachineTraceMetrics:
Collaboration graph
[legend]

List of all members.

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 override
bool runOnMachineFunction (MachineFunction &) override
void releaseMemory () override
void verifyAnalysis () const override
const FixedBlockInfogetResources (const MachineBasicBlock *)
 Get the fixed resource information about MBB. Compute it on demand.
ArrayRef< unsignedgetProcResourceCycles (unsigned MBBNum) const
EnsemblegetEnsemble (Strategy)
void invalidate (const MachineBasicBlock *MBB)

Static Public Attributes

static char ID = 0

Friends

class Ensemble
class Trace

Detailed Description

Definition at line 67 of file MachineTraceMetrics.h.


Member Enumeration Documentation

Strategies for selecting traces.

Enumerator:
TS_MinInstrCount 

Select the trace through a block that has the fewest instructions.

TS_NumStrategies 

Definition at line 341 of file MachineTraceMetrics.h.


Constructor & Destructor Documentation

Definition at line 40 of file MachineTraceMetrics.cpp.

References llvm::sys::path::begin(), and llvm::sys::path::end().


Member Function Documentation

void MachineTraceMetrics::getAnalysisUsage ( AnalysisUsage AU) const [override, 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 46 of file MachineTraceMetrics.cpp.

References llvm::AnalysisUsage::addRequired(), and llvm::AnalysisUsage::setPreservesAll().

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 372 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(), llvm::makeArrayRef(), and llvm::SmallVectorTemplateCommon< T, typename >::size().

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 385 of file MachineTraceMetrics.cpp.

References llvm::dbgs(), DEBUG, llvm::MachineBasicBlock::getNumber(), llvm::MachineTraceMetrics::Ensemble::invalidate(), and TS_NumStrategies.

void MachineTraceMetrics::releaseMemory ( ) [override, 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 68 of file MachineTraceMetrics.cpp.

References llvm::SmallVectorImpl< T >::clear(), and TS_NumStrategies.

void MachineTraceMetrics::verifyAnalysis ( ) const [override, virtual]

verifyAnalysis() - This member can be implemented by a analysis pass to check state of analysis information.

Reimplemented from llvm::Pass.

Definition at line 393 of file MachineTraceMetrics.cpp.

References llvm::MachineFunction::getNumBlockIDs(), llvm::SmallVectorTemplateCommon< T, typename >::size(), TS_NumStrategies, and llvm::MachineTraceMetrics::Ensemble::verify().


Friends And Related Function Documentation

friend class Ensemble [friend]

Definition at line 85 of file MachineTraceMetrics.h.

friend class Trace [friend]

Definition at line 86 of file MachineTraceMetrics.h.

Referenced by llvm::MachineTraceMetrics::Ensemble::getTrace().


Member Data Documentation

char MachineTraceMetrics::ID = 0 [static]

Definition at line 77 of file MachineTraceMetrics.h.


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