LLVM 20.0.0git
|
Manages hardware register files, and tracks register definitions for register renaming purposes. More...
#include "llvm/MCA/HardwareUnits/RegisterFile.h"
Classes | |
struct | RAWHazard |
Manages hardware register files, and tracks register definitions for register renaming purposes.
Definition at line 83 of file RegisterFile.h.
llvm::mca::RegisterFile::RegisterFile | ( | const MCSchedModel & | SM, |
const MCRegisterInfo & | mri, | ||
unsigned | NumRegs = 0 |
||
) |
Definition at line 64 of file RegisterFile.cpp.
void llvm::mca::RegisterFile::addRegisterRead | ( | ReadState & | RS, |
const MCSubtargetInfo & | STI | ||
) | const |
Definition at line 618 of file RegisterFile.cpp.
References llvm::mca::WriteState::addUser(), assert(), collectWrites(), llvm::mca::ReadState::getDescriptor(), getElapsedCyclesFromWriteBack(), llvm::MCSubtargetInfo::getReadAdvanceCycles(), llvm::mca::ReadState::getRegisterID(), llvm::MCSchedModel::getSchedClassDesc(), llvm::MCSubtargetInfo::getSchedModel(), llvm::mca::ReadState::isIndependentFromDef(), llvm::mca::ReadDescriptor::SchedClassID, llvm::mca::ReadState::setDependentWrites(), llvm::mca::ReadState::setPRF(), llvm::mca::ReadState::setReadZero(), llvm::SmallVectorBase< Size_T >::size(), llvm::mca::ReadDescriptor::UseIndex, and llvm::mca::ReadState::writeStartEvent().
Referenced by llvm::mca::addRegisterReadWrite().
void llvm::mca::RegisterFile::addRegisterWrite | ( | WriteRef | Write, |
MutableArrayRef< unsigned > | UsedPhysRegs | ||
) |
Definition at line 228 of file RegisterFile.cpp.
References llvm::mca::WriteState::addUser(), assert(), llvm::mca::WriteState::clearsSuperRegisters(), llvm::dbgs(), llvm::mca::WriteState::getLatency(), llvm::MCRegisterInfo::getName(), llvm::mca::WriteState::getRegisterID(), llvm::mca::WriteRef::getSourceIndex(), llvm::mca::WriteRef::getWriteState(), I, llvm::mca::WriteState::isEliminated(), llvm::mca::WriteState::isWriteZero(), LLVM_DEBUG, llvm::APInt::setBitVal(), llvm::mca::WriteState::setPRF(), llvm::MCRegisterInfo::subregs(), llvm::MCRegisterInfo::superregs(), and llvm::Write.
Referenced by llvm::mca::addRegisterReadWrite().
bool llvm::mca::RegisterFile::canEliminateMove | ( | const WriteState & | WS, |
const ReadState & | RS, | ||
unsigned | PRFIndex | ||
) | const |
Definition at line 384 of file RegisterFile.cpp.
References llvm::mca::WriteState::clearsSuperRegisters(), llvm::mca::WriteState::getRegisterID(), and llvm::mca::ReadState::getRegisterID().
Referenced by tryEliminateMoveOrSwap().
RegisterFile::RAWHazard llvm::mca::RegisterFile::checkRAWHazards | ( | const MCSubtargetInfo & | STI, |
const ReadState & | RS | ||
) | const |
Definition at line 568 of file RegisterFile.cpp.
References assert(), llvm::SmallVectorImpl< T >::clear(), collectWrites(), llvm::mca::RegisterFile::RAWHazard::CyclesLeft, llvm::mca::WriteState::getCyclesLeft(), llvm::mca::ReadState::getDescriptor(), getElapsedCyclesFromWriteBack(), llvm::MCSubtargetInfo::getReadAdvanceCycles(), llvm::MCSchedModel::getSchedClassDesc(), llvm::MCSubtargetInfo::getSchedModel(), llvm::mca::WriteState::getWriteResourceID(), llvm::mca::RegisterFile::RAWHazard::isValid(), llvm::mca::RegisterFile::RAWHazard::RegisterID, llvm::mca::ReadDescriptor::SchedClassID, llvm::mca::UNKNOWN_CYCLES, llvm::mca::ReadDescriptor::UseIndex, and Writes.
Referenced by llvm::mca::checkRegisterHazard().
void llvm::mca::RegisterFile::collectWrites | ( | const MCSubtargetInfo & | STI, |
const ReadState & | RS, | ||
SmallVectorImpl< WriteRef > & | Writes, | ||
SmallVectorImpl< WriteRef > & | CommittedWrites | ||
) | const |
Definition at line 502 of file RegisterFile.cpp.
References assert(), llvm::SmallVectorTemplateCommon< T, typename >::begin(), llvm::dbgs(), llvm::mca::ReadState::getDescriptor(), getElapsedCyclesFromWriteBack(), llvm::MCRegisterInfo::getName(), llvm::MCSubtargetInfo::getReadAdvanceCycles(), llvm::mca::WriteState::getRegisterID(), llvm::mca::ReadState::getRegisterID(), llvm::MCSchedModel::getSchedClassDesc(), llvm::MCSubtargetInfo::getSchedModel(), llvm::mca::WriteRef::getSourceIndex(), llvm::mca::WriteRef::getWriteResourceID(), llvm::mca::WriteRef::getWriteState(), llvm::mca::WriteRef::hasKnownWriteBackCycle(), I, LLVM_DEBUG, llvm::SmallVectorTemplateBase< T, bool >::push_back(), llvm::SmallVectorImpl< T >::resize(), llvm::mca::ReadDescriptor::SchedClassID, llvm::SmallVectorBase< Size_T >::size(), llvm::sort(), llvm::MCRegisterInfo::subregs(), llvm::unique(), llvm::mca::ReadDescriptor::UseIndex, and Writes.
Referenced by addRegisterRead(), and checkRAWHazards().
|
inline |
Definition at line 302 of file RegisterFile.h.
Referenced by llvm::mca::InOrderIssueStage::cycleEnd(), and llvm::mca::RetireStage::cycleEnd().
void llvm::mca::RegisterFile::cycleStart | ( | ) |
Definition at line 100 of file RegisterFile.cpp.
Referenced by llvm::mca::InOrderIssueStage::cycleStart(), and llvm::mca::RetireStage::cycleStart().
void llvm::mca::RegisterFile::dump | ( | ) | const |
Definition at line 717 of file RegisterFile.cpp.
References llvm::dbgs(), E, llvm::MCRegisterInfo::getName(), getNumRegisterFiles(), llvm::MCRegisterInfo::getNumRegs(), and I.
Referenced by llvm::mca::DispatchStage::dump().
Definition at line 497 of file RegisterFile.cpp.
References assert(), llvm::mca::WriteRef::getWriteBackCycle(), and llvm::mca::WriteRef::hasKnownWriteBackCycle().
Referenced by addRegisterRead(), checkRAWHazards(), and collectWrites().
|
inline |
Definition at line 293 of file RegisterFile.h.
References llvm::SmallVectorBase< Size_T >::size().
Referenced by llvm::mca::DispatchStage::cycleStart(), dump(), isAvailable(), and llvm::mca::RetireStage::notifyInstructionRetired().
Definition at line 660 of file RegisterFile.cpp.
References llvm::dbgs(), E, getNumRegisterFiles(), I, and LLVM_DEBUG.
void llvm::mca::RegisterFile::onInstructionExecuted | ( | Instruction * | IS | ) |
Definition at line 105 of file RegisterFile.cpp.
References assert(), llvm::mca::InstructionBase::getDefs(), llvm::mca::WriteRef::getWriteState(), I, llvm::mca::Instruction::isExecuted(), llvm::mca::WriteRef::notifyExecuted(), llvm::MCRegisterInfo::subregs(), llvm::MCRegisterInfo::superregs(), and llvm::mca::UNKNOWN_CYCLES.
Referenced by llvm::mca::RetireStage::execute().
void llvm::mca::RegisterFile::removeRegisterWrite | ( | const WriteState & | WS, |
MutableArrayRef< unsigned > | FreedPhysRegs | ||
) |
Definition at line 332 of file RegisterFile.cpp.
References assert(), llvm::mca::WriteState::clearsSuperRegisters(), llvm::mca::WriteRef::commit(), llvm::mca::WriteState::getCyclesLeft(), llvm::mca::WriteState::getRegisterID(), llvm::mca::WriteRef::getWriteState(), I, llvm::mca::WriteState::isEliminated(), llvm::mca::WriteState::isWriteZero(), llvm::MCRegisterInfo::subregs(), llvm::MCRegisterInfo::superregs(), and llvm::mca::UNKNOWN_CYCLES.
Referenced by llvm::mca::RetireStage::notifyInstructionRetired().
bool llvm::mca::RegisterFile::tryEliminateMoveOrSwap | ( | MutableArrayRef< WriteState > | Writes, |
MutableArrayRef< ReadState > | Reads | ||
) |
Definition at line 426 of file RegisterFile.cpp.
References canEliminateMove(), E, llvm::SmallVectorBase< Size_T >::empty(), llvm::mca::WriteState::getRegisterID(), llvm::mca::ReadState::getRegisterID(), I, if(), llvm::mca::WriteState::setEliminated(), llvm::mca::ReadState::setReadZero(), llvm::mca::WriteState::setWriteZero(), llvm::ArrayRef< T >::size(), llvm::SmallVectorBase< Size_T >::size(), llvm::MCRegisterInfo::subregs(), and Writes.