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 69 of file RegisterFile.cpp.
void llvm::mca::RegisterFile::addRegisterRead | ( | ReadState & | RS, |
const MCSubtargetInfo & | STI | ||
) | const |
Definition at line 626 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 233 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::isNonArtificial(), llvm::mca::WriteState::isWriteZero(), LLVM_DEBUG, llvm::make_filter_range(), 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 391 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 576 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 510 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 105 of file RegisterFile.cpp.
Referenced by llvm::mca::InOrderIssueStage::cycleStart(), and llvm::mca::RetireStage::cycleStart().
void llvm::mca::RegisterFile::dump | ( | ) | const |
Definition at line 725 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 505 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 668 of file RegisterFile.cpp.
References llvm::dbgs(), E, getNumRegisterFiles(), I, and LLVM_DEBUG.
void llvm::mca::RegisterFile::onInstructionExecuted | ( | Instruction * | IS | ) |
Definition at line 110 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 339 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 433 of file RegisterFile.cpp.
References canEliminateMove(), E, llvm::SmallVectorBase< Size_T >::empty(), llvm::mca::WriteState::getRegisterID(), llvm::mca::ReadState::getRegisterID(), I, llvm::mca::isNonArtificial(), llvm::make_filter_range(), 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.