LLVM 22.0.0git
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
LLVM_ABI void addUser (unsigned IID, ReadState *Use, int ReadAdvance)
LLVM_ABI 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)
LLVM_ABI void writeStartEvent (unsigned IID, MCPhysReg RegID, unsigned Cycles)
void setWriteZero ()
void setEliminated ()
void setPRF (unsigned PRF)
LLVM_ABI void cycleEvent ()
LLVM_ABI 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 198 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

◆ WriteState() [2/2]

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

References llvm::Other, and WriteState().

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(), llvm::mca::UNKNOWN_CYCLES, and WriteState().

◆ 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

Definition at line 125 of file Instruction.cpp.

References llvm::dbgs(), getCyclesLeft(), getLatency(), and getRegisterID().

Referenced by llvm::mca::WriteRef::dump().

◆ getCriticalRegDep()

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

Definition at line 269 of file Instruction.h.

◆ getCyclesLeft()

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

◆ getDependentWrite()

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

Definition at line 268 of file Instruction.h.

References WriteState().

◆ getDependentWriteCyclesLeft()

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

Definition at line 265 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 281 of file Instruction.h.

◆ getRegisterFileID()

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

Definition at line 263 of file Instruction.h.

◆ getRegisterID()

◆ getWriteResourceID()

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

Definition at line 260 of file Instruction.h.

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

◆ isEliminated()

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

◆ isExecuted()

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

Definition at line 299 of file Instruction.h.

References llvm::mca::UNKNOWN_CYCLES.

◆ isReady()

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

Definition at line 292 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

References llvm::Other, and WriteState().

◆ setDependentWrite()

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

Definition at line 303 of file Instruction.h.

References llvm::Other, and WriteState().

◆ setEliminated()

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

Definition at line 306 of file Instruction.h.

References assert().

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

◆ setPRF()

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

Definition at line 312 of file Instruction.h.

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

◆ setRegisterID()

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

Definition at line 262 of file Instruction.h.

◆ setWriteZero()

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

Definition at line 305 of file Instruction.h.

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

◆ writeStartEvent()

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

Definition at line 21 of file Instruction.cpp.


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