LLVM 20.0.0git
Public Member Functions | Public Attributes | List of all members
llvm::MachineTraceMetrics::TraceBlockInfo Struct Reference

Per-basic block information that relates to a specific trace through the block. More...

#include "llvm/CodeGen/MachineTraceMetrics.h"

Public Member Functions

 TraceBlockInfo ()=default
 
bool hasValidDepth () const
 Returns true if the depth resources have been computed from the trace above this block.
 
bool hasValidHeight () const
 Returns true if the height resources have been computed from the trace below this block.
 
void invalidateDepth ()
 Invalidate depth resources when some block above this one has changed.
 
void invalidateHeight ()
 Invalidate height resources when a block below this one has changed.
 
bool isUsefulDominator (const TraceBlockInfo &TBI) const
 Assuming that this is a dominator of TBI, determine if it contains useful instruction depths.
 
void print (raw_ostream &) const
 
void dump () const
 

Public Attributes

const MachineBasicBlockPred = nullptr
 Trace predecessor, or NULL for the first block in the trace.
 
const MachineBasicBlockSucc = nullptr
 Trace successor, or NULL for the last block in the trace.
 
unsigned Head
 The block number of the head of the trace. (When hasValidDepth()).
 
unsigned Tail
 The block number of the tail of the trace. (When hasValidHeight()).
 
unsigned InstrDepth = ~0u
 Accumulated number of instructions in the trace above this block.
 
unsigned InstrHeight = ~0u
 Accumulated number of instructions in the trace below this block.
 
bool HasValidInstrDepths = false
 Instruction depths have been computed. This implies hasValidDepth().
 
bool HasValidInstrHeights = false
 Instruction heights have been computed. This implies hasValidHeight().
 
unsigned CriticalPath
 Critical path length.
 
SmallVector< LiveInReg, 4 > LiveIns
 Live-in registers.
 

Detailed Description

Per-basic block information that relates to a specific trace through the block.

Convergent traces means that only one of these is required per block in a trace ensemble.

Definition at line 171 of file MachineTraceMetrics.h.

Constructor & Destructor Documentation

◆ TraceBlockInfo()

llvm::MachineTraceMetrics::TraceBlockInfo::TraceBlockInfo ( )
default

Member Function Documentation

◆ dump()

void llvm::MachineTraceMetrics::TraceBlockInfo::dump ( ) const
inline

Definition at line 253 of file MachineTraceMetrics.h.

References llvm::dbgs(), and print().

◆ hasValidDepth()

bool llvm::MachineTraceMetrics::TraceBlockInfo::hasValidDepth ( ) const
inline

◆ hasValidHeight()

bool llvm::MachineTraceMetrics::TraceBlockInfo::hasValidHeight ( ) const
inline

◆ invalidateDepth()

void llvm::MachineTraceMetrics::TraceBlockInfo::invalidateDepth ( )
inline

Invalidate depth resources when some block above this one has changed.

Definition at line 205 of file MachineTraceMetrics.h.

References HasValidInstrDepths, and InstrDepth.

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

◆ invalidateHeight()

void llvm::MachineTraceMetrics::TraceBlockInfo::invalidateHeight ( )
inline

Invalidate height resources when a block below this one has changed.

Definition at line 208 of file MachineTraceMetrics.h.

References HasValidInstrHeights, and InstrHeight.

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

◆ isUsefulDominator()

bool llvm::MachineTraceMetrics::TraceBlockInfo::isUsefulDominator ( const TraceBlockInfo TBI) const
inline

Assuming that this is a dominator of TBI, determine if it contains useful instruction depths.

A dominating block can be above the current trace head, and any dependencies from such a far away dominator are not expected to affect the critical path.

Also returns true when TBI == this.

Definition at line 216 of file MachineTraceMetrics.h.

References hasValidDepth(), HasValidInstrDepths, Head, and InstrDepth.

Referenced by llvm::MachineTraceMetrics::Trace::isDepInTrace(), and llvm::MachineTraceMetrics::Ensemble::updateDepth().

◆ print()

void MachineTraceMetrics::TraceBlockInfo::print ( raw_ostream OS) const

Definition at line 1331 of file MachineTraceMetrics.cpp.

References OS, llvm::printMBBReference(), and llvm::CallingConv::Tail.

Referenced by dump().

Member Data Documentation

◆ CriticalPath

unsigned llvm::MachineTraceMetrics::TraceBlockInfo::CriticalPath

Critical path length.

This is the number of cycles in the longest data dependency chain through the trace. This is only valid when both HasValidInstrDepths and HasValidInstrHeights are set.

Definition at line 244 of file MachineTraceMetrics.h.

Referenced by llvm::MachineTraceMetrics::Trace::getCriticalPath(), and llvm::MachineTraceMetrics::Ensemble::updateDepth().

◆ HasValidInstrDepths

bool llvm::MachineTraceMetrics::TraceBlockInfo::HasValidInstrDepths = false

◆ HasValidInstrHeights

bool llvm::MachineTraceMetrics::TraceBlockInfo::HasValidInstrHeights = false

◆ Head

unsigned llvm::MachineTraceMetrics::TraceBlockInfo::Head

The block number of the head of the trace. (When hasValidDepth()).

Definition at line 181 of file MachineTraceMetrics.h.

Referenced by isUsefulDominator().

◆ InstrDepth

unsigned llvm::MachineTraceMetrics::TraceBlockInfo::InstrDepth = ~0u

Accumulated number of instructions in the trace above this block.

Does not include instructions in this block.

Definition at line 188 of file MachineTraceMetrics.h.

Referenced by llvm::MachineTraceMetrics::Trace::getInstrCount(), hasValidDepth(), invalidateDepth(), and isUsefulDominator().

◆ InstrHeight

unsigned llvm::MachineTraceMetrics::TraceBlockInfo::InstrHeight = ~0u

Accumulated number of instructions in the trace below this block.

Includes instructions in this block.

Definition at line 192 of file MachineTraceMetrics.h.

Referenced by llvm::MachineTraceMetrics::Trace::getInstrCount(), hasValidHeight(), and invalidateHeight().

◆ LiveIns

SmallVector<LiveInReg, 4> llvm::MachineTraceMetrics::TraceBlockInfo::LiveIns

Live-in registers.

These registers are defined above the current block and used by this block or a block below it. This does not include PHI uses in the current block, but it does include PHI uses in deeper blocks.

Definition at line 250 of file MachineTraceMetrics.h.

◆ Pred

const MachineBasicBlock* llvm::MachineTraceMetrics::TraceBlockInfo::Pred = nullptr

◆ Succ

const MachineBasicBlock* llvm::MachineTraceMetrics::TraceBlockInfo::Succ = nullptr

Trace successor, or NULL for the last block in the trace.

Valid when hasValidHeight().

Definition at line 178 of file MachineTraceMetrics.h.

Referenced by llvm::MachineTraceMetrics::Ensemble::invalidate(), and llvm::MachineTraceMetrics::Ensemble::verify().

◆ Tail

unsigned llvm::MachineTraceMetrics::TraceBlockInfo::Tail

The block number of the tail of the trace. (When hasValidHeight()).

Definition at line 184 of file MachineTraceMetrics.h.


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