LLVM 20.0.0git
Public Member Functions | List of all members
llvm::mca::WriteState Class Reference

Tracks uses of a register definition (e.g. More...

#include "llvm/MCA/Instruction.h"

Public Member Functions

 WriteState (const WriteDescriptor &Desc, MCPhysReg RegID, bool clearsSuperRegs=false, bool writesZero=false)
 
 WriteState (const WriteState &Other)=default
 
WriteStateoperator= (const WriteState &Other)=default
 
int getCyclesLeft () const
 
unsigned getWriteResourceID () const
 
MCPhysReg getRegisterID () const
 
void setRegisterID (const MCPhysReg RegID)
 
unsigned getRegisterFileID () const
 
unsigned getLatency () const
 
unsigned getDependentWriteCyclesLeft () const
 
const WriteStategetDependentWrite () const
 
const CriticalDependencygetCriticalRegDep () const
 
void addUser (unsigned IID, ReadState *Use, int ReadAdvance)
 
void addUser (unsigned IID, WriteState *Use)
 
unsigned getNumUsers () const
 
bool clearsSuperRegisters () const
 
bool isWriteZero () const
 
bool isEliminated () const
 
bool isReady () const
 
bool isExecuted () const
 
void setDependentWrite (const WriteState *Other)
 
void writeStartEvent (unsigned IID, MCPhysReg RegID, unsigned Cycles)
 
void setWriteZero ()
 
void setEliminated ()
 
void setPRF (unsigned PRF)
 
void cycleEvent ()
 
void onInstructionIssued (unsigned IID)
 
void dump () const
 

Detailed Description

Tracks uses of a register definition (e.g.

register write).

Each implicit/explicit register write is associated with an instance of this class. A WriteState object tracks the dependent users of a register write. It also tracks how many cycles are left before the write back stage.

Definition at line 197 of file Instruction.h.

Constructor & Destructor Documentation

◆ WriteState() [1/2]

llvm::mca::WriteState::WriteState ( const WriteDescriptor Desc,
MCPhysReg  RegID,
bool  clearsSuperRegs = false,
bool  writesZero = false 
)
inline

Definition at line 248 of file Instruction.h.

◆ WriteState() [2/2]

llvm::mca::WriteState::WriteState ( const WriteState Other)
default

Member Function Documentation

◆ addUser() [1/2]

void llvm::mca::WriteState::addUser ( unsigned  IID,
ReadState Use,
int  ReadAdvance 
)

◆ addUser() [2/2]

void llvm::mca::WriteState::addUser ( unsigned  IID,
WriteState Use 
)

Definition at line 85 of file Instruction.cpp.

References assert(), and llvm::mca::UNKNOWN_CYCLES.

◆ clearsSuperRegisters()

bool llvm::mca::WriteState::clearsSuperRegisters ( ) const
inline

◆ cycleEvent()

void llvm::mca::WriteState::cycleEvent ( )

Definition at line 96 of file Instruction.cpp.

References llvm::mca::UNKNOWN_CYCLES.

◆ dump()

void llvm::mca::WriteState::dump ( ) const

◆ getCriticalRegDep()

const CriticalDependency & llvm::mca::WriteState::getCriticalRegDep ( ) const
inline

Definition at line 268 of file Instruction.h.

◆ getCyclesLeft()

int llvm::mca::WriteState::getCyclesLeft ( ) const
inline

◆ getDependentWrite()

const WriteState * llvm::mca::WriteState::getDependentWrite ( ) const
inline

Definition at line 267 of file Instruction.h.

◆ getDependentWriteCyclesLeft()

unsigned llvm::mca::WriteState::getDependentWriteCyclesLeft ( ) const
inline

Definition at line 264 of file Instruction.h.

Referenced by isReady().

◆ getLatency()

unsigned llvm::mca::WriteState::getLatency ( ) const
inline

◆ getNumUsers()

unsigned llvm::mca::WriteState::getNumUsers ( ) const
inline

Definition at line 280 of file Instruction.h.

References Users.

◆ getRegisterFileID()

unsigned llvm::mca::WriteState::getRegisterFileID ( ) const
inline

Definition at line 262 of file Instruction.h.

◆ getRegisterID()

MCPhysReg llvm::mca::WriteState::getRegisterID ( ) const
inline

◆ getWriteResourceID()

unsigned llvm::mca::WriteState::getWriteResourceID ( ) const
inline

◆ isEliminated()

bool llvm::mca::WriteState::isEliminated ( ) const
inline

◆ isExecuted()

bool llvm::mca::WriteState::isExecuted ( ) const
inline

◆ isReady()

bool llvm::mca::WriteState::isReady ( ) const
inline

Definition at line 291 of file Instruction.h.

References getDependentWriteCyclesLeft(), and getLatency().

◆ isWriteZero()

bool llvm::mca::WriteState::isWriteZero ( ) const
inline

◆ onInstructionIssued()

void llvm::mca::WriteState::onInstructionIssued ( unsigned  IID)

◆ operator=()

WriteState & llvm::mca::WriteState::operator= ( const WriteState Other)
default

◆ setDependentWrite()

void llvm::mca::WriteState::setDependentWrite ( const WriteState Other)
inline

Definition at line 302 of file Instruction.h.

References llvm::Other.

◆ setEliminated()

void llvm::mca::WriteState::setEliminated ( )
inline

Definition at line 305 of file Instruction.h.

References assert(), and Users.

Referenced by llvm::mca::RegisterFile::tryEliminateMoveOrSwap().

◆ setPRF()

void llvm::mca::WriteState::setPRF ( unsigned  PRF)
inline

Definition at line 311 of file Instruction.h.

Referenced by llvm::mca::RegisterFile::addRegisterWrite().

◆ setRegisterID()

void llvm::mca::WriteState::setRegisterID ( const MCPhysReg  RegID)
inline

Definition at line 261 of file Instruction.h.

◆ setWriteZero()

void llvm::mca::WriteState::setWriteZero ( )
inline

Definition at line 304 of file Instruction.h.

Referenced by llvm::mca::RegisterFile::tryEliminateMoveOrSwap().

◆ writeStartEvent()

void llvm::mca::WriteState::writeStartEvent ( unsigned  IID,
MCPhysReg  RegID,
unsigned  Cycles 
)

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