47 #ifndef LLVM_CODEGEN_MACHINE_TRACE_METRICS_H
48 #define LLVM_CODEGEN_MACHINE_TRACE_METRICS_H
57 class InstrItineraryData;
58 class MachineBasicBlock;
61 class MachineLoopInfo;
62 class MachineRegisterInfo;
63 class TargetInstrInfo;
64 class TargetRegisterInfo;
240 unsigned getBlockNum()
const {
return &TBI - &TE.BlockInfo[0]; }
278 return TE.Cycles.lookup(MI);
307 void addLiveIns(
const MachineInstr *DefMI,
unsigned DefOp,
323 virtual const char *
getName()
const =0;
372 unsigned getCycles(
unsigned Scaled) {
374 return (Scaled + Factor - 1) / Factor;
void print(raw_ostream &) const
bool HasValidInstrDepths
Instruction depths have been computed. This implies hasValidDepth().
ArrayRef< unsigned > getProcResourceDepths(unsigned MBBNum) const
void print(raw_ostream &) const
void print(raw_ostream &) const
const MachineBasicBlock * Pred
bool HasCalls
True when the block contains calls.
unsigned getCriticalPath() const
void invalidateHeight()
Invalidate height resources when a block below this one has changed.
Trace(Ensemble &te, TraceBlockInfo &tbi)
unsigned getInstrCount() const
Compute the total number of instructions in the trace.
Provide an instruction scheduling machine model to CodeGen passes.
const MachineLoop * getLoopFor(const MachineBasicBlock *) const
Strategy
Strategies for selecting traces.
bool isUsefulDominator(const TraceBlockInfo &TBI) const
LiveInReg(unsigned Reg, unsigned Height=0)
virtual const MachineBasicBlock * pickTraceSucc(const MachineBasicBlock *)=0
Select the trace through a block that has the fewest instructions.
const TraceBlockInfo * getHeightResources(const MachineBasicBlock *) const
void verifyAnalysis() const
void invalidateDepth()
Invalidate depth resources when some block above this one has changed.
void invalidate(const MachineBasicBlock *MBB)
Invalidate traces through BadMBB.
void invalidate()
Invalidate resource information.
bool HasValidInstrHeights
Instruction heights have been computed. This implies hasValidHeight().
Ensemble * getEnsemble(Strategy)
Ensemble(MachineTraceMetrics *)
MachineTraceMetrics & MTM
unsigned getLatencyFactor() const
Multiply cycle count by this factor to normalize it relative to other resources. This is the number o...
const MachineBasicBlock * Succ
const FixedBlockInfo * getResources(const MachineBasicBlock *)
Get the fixed resource information about MBB. Compute it on demand.
unsigned Tail
The block number of the tail of the trace. (When hasValidHeight()).
const TraceBlockInfo * getDepthResources(const MachineBasicBlock *) const
virtual const char * getName() const =0
virtual const MachineBasicBlock * pickTracePred(const MachineBasicBlock *)=0
ArrayRef< unsigned > getProcResourceHeights(unsigned MBBNum) const
bool hasValidDepth() const
bool runOnMachineFunction(MachineFunction &)
unsigned getResourceLength(ArrayRef< const MachineBasicBlock * > Extrablocks=None, ArrayRef< const MCSchedClassDesc * > ExtraInstrs=None) const
void invalidate(const MachineBasicBlock *MBB)
unsigned Head
The block number of the head of the trace. (When hasValidDepth()).
unsigned Reg
The virtual register required, or a register unit.
bool hasResources() const
Returns true when resource information for this block has been computed.
InstrCycles getInstrCycles(const MachineInstr *MI) const
void getAnalysisUsage(AnalysisUsage &) const
bool hasValidHeight() const
raw_ostream & operator<<(raw_ostream &OS, const APInt &I)
unsigned getPHIDepth(const MachineInstr *PHI) const
SmallVector< LiveInReg, 4 > LiveIns
unsigned getResourceDepth(bool Bottom) const
ArrayRef< unsigned > getProcResourceCycles(unsigned MBBNum) const
Trace getTrace(const MachineBasicBlock *MBB)
unsigned getInstrSlack(const MachineInstr *MI) const