LLVM
8.0.1
|
Manages hardware register files, and tracks register definitions for register renaming purposes. More...
#include "llvm/MCA/HardwareUnits/RegisterFile.h"
Public Member Functions | |
RegisterFile (const MCSchedModel &SM, const MCRegisterInfo &mri, unsigned NumRegs=0) | |
void | addRegisterWrite (WriteRef Write, MutableArrayRef< unsigned > UsedPhysRegs) |
void | addRegisterRead (ReadState &RS, SmallVectorImpl< WriteRef > &Writes) const |
void | removeRegisterWrite (const WriteState &WS, MutableArrayRef< unsigned > FreedPhysRegs) |
bool | tryEliminateMove (WriteState &WS, ReadState &RS) |
unsigned | isAvailable (ArrayRef< unsigned > Regs) const |
unsigned | getNumRegisterFiles () const |
void | cycleStart () |
void | dump () const |
Public Member Functions inherited from llvm::mca::HardwareUnit | |
HardwareUnit ()=default | |
virtual | ~HardwareUnit () |
Manages hardware register files, and tracks register definitions for register renaming purposes.
Definition at line 36 of file RegisterFile.h.
llvm::mca::RegisterFile::RegisterFile | ( | const MCSchedModel & | SM, |
const MCRegisterInfo & | mri, | ||
unsigned | NumRegs = 0 |
||
) |
Definition at line 26 of file RegisterFile.cpp.
References assert(), E, llvm::SmallVectorImpl< T >::emplace_back(), llvm::MCSchedModel::getExtraProcessorInfo(), llvm::MCSchedModel::hasExtraProcessorInfo(), I, Info, llvm::MCRegisterFileDesc::NumPhysRegs, llvm::MCRegisterFileDesc::NumRegisterCostEntries, llvm::MCExtraProcessorInfo::NumRegisterFiles, llvm::MCRegisterFileDesc::RegisterCostEntryIdx, llvm::MCExtraProcessorInfo::RegisterCostTable, and llvm::MCExtraProcessorInfo::RegisterFiles.
void llvm::mca::RegisterFile::addRegisterRead | ( | ReadState & | RS, |
SmallVectorImpl< WriteRef > & | Writes | ||
) | const |
void llvm::mca::RegisterFile::addRegisterWrite | ( | WriteRef | Write, |
MutableArrayRef< unsigned > | UsedPhysRegs | ||
) |
Definition at line 148 of file RegisterFile.cpp.
References llvm::mca::WriteState::addUser(), assert(), llvm::APInt::clearBit(), llvm::mca::WriteState::clearsSuperRegisters(), llvm::dbgs(), 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, second, llvm::APInt::setBit(), and llvm::mca::WriteState::setPRF().
void llvm::mca::RegisterFile::cycleStart | ( | ) |
Definition at line 62 of file RegisterFile.cpp.
References llvm::MCRegisterFileDesc::AllowZeroMoveEliminationOnly, llvm::SmallVectorImpl< T >::emplace_back(), llvm::ArrayRef< T >::empty(), llvm::errs(), llvm::MCRegisterInfo::getName(), llvm::MCRegisterInfo::getRegClass(), I, llvm::MCRegisterInfo::isSuperRegister(), llvm::MCRegisterFileDesc::MaxMovesEliminatedPerCycle, llvm::MCRegisterFileDesc::NumPhysRegs, Reg, and llvm::SmallVectorBase::size().
Referenced by llvm::mca::DispatchStage::cycleStart(), and getNumRegisterFiles().
void llvm::mca::RegisterFile::dump | ( | ) | const |
Definition at line 466 of file RegisterFile.cpp.
References llvm::dbgs(), llvm::APInt::dump(), E, llvm::MCRegisterInfo::getName(), getNumRegisterFiles(), llvm::MCRegisterInfo::getNumRegs(), I, and llvm::NVPTX::PTXCvtMode::RM.
Referenced by llvm::mca::DispatchStage::dump(), and getNumRegisterFiles().
|
inline |
Definition at line 226 of file RegisterFile.h.
References cycleStart(), dump(), and llvm::SmallVectorBase::size().
Referenced by llvm::mca::DispatchStage::cycleStart(), dump(), isAvailable(), and llvm::mca::RetireStage::notifyInstructionRetired().
Definition at line 418 of file RegisterFile.cpp.
References llvm::dbgs(), E, getNumRegisterFiles(), I, and LLVM_DEBUG.
void llvm::mca::RegisterFile::removeRegisterWrite | ( | const WriteState & | WS, |
MutableArrayRef< unsigned > | FreedPhysRegs | ||
) |
Definition at line 244 of file RegisterFile.cpp.
References assert(), llvm::mca::WriteState::clearsSuperRegisters(), llvm::mca::WriteState::getCyclesLeft(), llvm::mca::WriteState::getRegisterID(), llvm::mca::WriteRef::getWriteState(), I, llvm::mca::WriteRef::invalidate(), llvm::mca::WriteState::isEliminated(), llvm::mca::WriteState::isWriteZero(), second, and llvm::mca::UNKNOWN_CYCLES.
Referenced by llvm::mca::RetireStage::notifyInstructionRetired().
bool llvm::mca::RegisterFile::tryEliminateMove | ( | WriteState & | WS, |
ReadState & | RS | ||
) |
Definition at line 292 of file RegisterFile.cpp.
References assert(), llvm::SmallVectorTemplateCommon< T >::begin(), llvm::mca::WriteState::clearsSuperRegisters(), llvm::dbgs(), llvm::SmallVectorTemplateCommon< T >::end(), llvm::MCRegisterInfo::getName(), llvm::mca::WriteState::getRegisterID(), llvm::mca::ReadState::getRegisterID(), llvm::mca::WriteRef::getSourceIndex(), llvm::mca::WriteRef::getWriteState(), I, llvm::mca::WriteRef::isValid(), LLVM_DEBUG, llvm::SmallVectorTemplateBase< T >::push_back(), llvm::SmallVectorImpl< T >::resize(), second, llvm::mca::WriteState::setEliminated(), llvm::mca::ReadState::setReadZero(), llvm::mca::WriteState::setWriteZero(), llvm::SmallVectorBase::size(), and llvm::sort().