LLVM
10.0.0svn
|
Abstract base interface for LS (load/store) units in llvm-mca. More...
#include "llvm/MCA/HardwareUnits/LSUnit.h"
Public Types | |
enum | Status { LSU_AVAILABLE = 0, LSU_LQUEUE_FULL, LSU_SQUEUE_FULL } |
Public Member Functions | |
LSUnitBase (const MCSchedModel &SM, unsigned LoadQueueSize, unsigned StoreQueueSize, bool AssumeNoAlias) | |
virtual | ~LSUnitBase () |
unsigned | getLoadQueueSize () const |
Returns the total number of entries in the load queue. More... | |
unsigned | getStoreQueueSize () const |
Returns the total number of entries in the store queue. More... | |
unsigned | getUsedLQEntries () const |
unsigned | getUsedSQEntries () const |
void | acquireLQSlot () |
void | acquireSQSlot () |
void | releaseLQSlot () |
void | releaseSQSlot () |
bool | assumeNoAlias () const |
virtual Status | isAvailable (const InstRef &IR) const =0 |
This method checks the availability of the load/store buffers. More... | |
virtual unsigned | dispatch (const InstRef &IR)=0 |
Allocates LS resources for instruction IR. More... | |
bool | isSQEmpty () const |
bool | isLQEmpty () const |
bool | isSQFull () const |
bool | isLQFull () const |
bool | isValidGroupID (unsigned Index) const |
bool | isReady (const InstRef &IR) const |
Check if a peviously dispatched instruction IR is now ready for execution. More... | |
bool | isPending (const InstRef &IR) const |
Check if instruction IR only depends on memory instructions that are currently executing. More... | |
bool | isWaiting (const InstRef &IR) const |
Check if instruction IR is still waiting on memory operations, and the wait time is still unknown. More... | |
bool | hasDependentUsers (const InstRef &IR) const |
const MemoryGroup & | getGroup (unsigned Index) const |
MemoryGroup & | getGroup (unsigned Index) |
unsigned | createMemoryGroup () |
virtual void | onInstructionExecuted (const InstRef &IR) |
virtual void | onInstructionRetired (const InstRef &IR) |
virtual void | onInstructionIssued (const InstRef &IR) |
virtual void | cycleEvent () |
void | dump () const |
![]() | |
HardwareUnit ()=default | |
virtual | ~HardwareUnit () |
Abstract base interface for LS (load/store) units in llvm-mca.
llvm::mca::LSUnitBase::LSUnitBase | ( | const MCSchedModel & | SM, |
unsigned | LoadQueueSize, | ||
unsigned | StoreQueueSize, | ||
bool | AssumeNoAlias | ||
) |
Definition at line 24 of file LSUnit.cpp.
References llvm::MCProcResourceDesc::BufferSize, llvm::MCSchedModel::getExtraProcessorInfo(), llvm::MCSchedModel::getProcResource(), llvm::MCSchedModel::hasExtraProcessorInfo(), llvm::MCExtraProcessorInfo::LoadQueueID, llvm::max(), and llvm::MCExtraProcessorInfo::StoreQueueID.
|
virtual |
Definition at line 42 of file LSUnit.cpp.
|
inline |
Definition at line 212 of file LSUnit.h.
Referenced by llvm::mca::LSUnit::dispatch().
|
inline |
Definition at line 213 of file LSUnit.h.
Referenced by llvm::mca::LSUnit::dispatch().
|
inline |
Definition at line 217 of file LSUnit.h.
References llvm::NoAlias.
Referenced by llvm::mca::LSUnit::dispatch().
|
inline |
Definition at line 288 of file LSUnit.h.
References llvm::DenseMapBase< DenseMap< KeyT, ValueT, KeyInfoT, BucketT >, KeyT, ValueT, KeyInfoT, BucketT >::insert(), IR, and llvm::mca::MemoryGroup::onInstructionExecuted().
Referenced by llvm::mca::LSUnit::dispatch().
|
virtual |
Definition at line 44 of file LSUnit.cpp.
References G.
Referenced by llvm::mca::Scheduler::cycleEvent().
Allocates LS resources for instruction IR.
This method assumes that a previous call to isAvailable(IR)
succeeded with a LSUnitBase::Status value of LSU_AVAILABLE. Returns the GroupID associated with this instruction. That value will be used to set the LSUTokenID field in class Instruction.
Implemented in llvm::mca::LSUnit.
Referenced by llvm::mca::Scheduler::dispatch().
void llvm::mca::LSUnitBase::dump | ( | ) | const |
Definition at line 50 of file LSUnit.cpp.
References llvm::dbgs(), getLoadQueueSize(), llvm::mca::MemoryGroup::getNumExecuted(), llvm::mca::MemoryGroup::getNumExecutedPredecessors(), llvm::mca::MemoryGroup::getNumExecuting(), llvm::mca::MemoryGroup::getNumExecutingPredecessors(), llvm::mca::MemoryGroup::getNumInstructions(), llvm::mca::MemoryGroup::getNumPredecessors(), getStoreQueueSize(), getUsedLQEntries(), and getUsedSQEntries().
|
inline |
Definition at line 278 of file LSUnit.h.
References assert(), and llvm::DenseMapBase< DenseMap< KeyT, ValueT, KeyInfoT, BucketT >, KeyT, ValueT, KeyInfoT, BucketT >::find().
Referenced by llvm::mca::LSUnit::dispatch(), and llvm::mca::Scheduler::isAvailable().
|
inline |
Definition at line 283 of file LSUnit.h.
References assert(), and llvm::DenseMapBase< DenseMap< KeyT, ValueT, KeyInfoT, BucketT >, KeyT, ValueT, KeyInfoT, BucketT >::find().
|
inline |
|
inline |
|
inline |
|
inline |
Definition at line 272 of file LSUnit.h.
References llvm::mca::InstRef::getInstruction(), llvm::mca::Instruction::getLSUTokenID(), llvm::mca::MemoryGroup::getNumSuccessors(), and llvm::mca::MemoryGroup::isExecuted().
Referenced by llvm::mca::Scheduler::issueInstruction().
This method checks the availability of the load/store buffers.
Returns LSU_AVAILABLE if there are enough load/store queue entries to accomodate instruction IR. By default, LSU_AVAILABLE is returned if IR is not a memory operation.
Implemented in llvm::mca::LSUnit.
Referenced by llvm::mca::Scheduler::isAvailable().
|
inline |
Definition at line 243 of file LSUnit.h.
Referenced by llvm::mca::LSUnit::isAvailable().
Check if instruction IR only depends on memory instructions that are currently executing.
Definition at line 258 of file LSUnit.h.
References llvm::mca::InstRef::getInstruction(), llvm::mca::Instruction::getLSUTokenID(), and llvm::mca::MemoryGroup::isPending().
Referenced by llvm::mca::Scheduler::analyzeDataDependencies(), and llvm::mca::Scheduler::dispatch().
Check if a peviously dispatched instruction IR is now ready for execution.
Definition at line 250 of file LSUnit.h.
References llvm::mca::InstRef::getInstruction(), llvm::mca::Instruction::getLSUTokenID(), and llvm::mca::MemoryGroup::isReady().
Referenced by llvm::mca::Scheduler::dispatch(), and llvm::mca::Scheduler::issueInstruction().
|
inline |
Definition at line 242 of file LSUnit.h.
Referenced by llvm::mca::LSUnit::isAvailable().
Definition at line 245 of file LSUnit.h.
References llvm::DenseMapBase< DenseMap< KeyT, ValueT, KeyInfoT, BucketT >, KeyT, ValueT, KeyInfoT, BucketT >::end(), and llvm::DenseMapBase< DenseMap< KeyT, ValueT, KeyInfoT, BucketT >, KeyT, ValueT, KeyInfoT, BucketT >::find().
Referenced by llvm::mca::LSUnit::onInstructionExecuted().
Check if instruction IR is still waiting on memory operations, and the wait time is still unknown.
Definition at line 266 of file LSUnit.h.
References llvm::mca::InstRef::getInstruction(), llvm::mca::Instruction::getLSUTokenID(), and llvm::mca::MemoryGroup::isWaiting().
Referenced by llvm::mca::Scheduler::dispatch(), and llvm::mca::Scheduler::issueInstruction().
Reimplemented in llvm::mca::LSUnit.
Definition at line 162 of file LSUnit.cpp.
References assert(), llvm::mca::InstRef::getInstruction(), and llvm::mca::Instruction::getLSUTokenID().
Referenced by llvm::mca::Scheduler::isAvailable(), llvm::mca::LSUnit::onInstructionExecuted(), and llvm::mca::Scheduler::select().
Definition at line 302 of file LSUnit.h.
References llvm::mca::MemoryGroup::cycleEvent(), llvm::dump(), llvm::mca::InstRef::getInstruction(), and llvm::mca::Instruction::getLSUTokenID().
Referenced by llvm::mca::Scheduler::isAvailable().
Definition at line 171 of file LSUnit.cpp.
References assert(), llvm::dbgs(), llvm::mca::InstructionBase::getDesc(), llvm::mca::InstRef::getInstruction(), llvm::mca::InstRef::getSourceIndex(), LLVM_DEBUG, llvm::mca::InstrDesc::MayLoad, llvm::mca::InstrDesc::MayStore, releaseLQSlot(), and releaseSQSlot().
Referenced by llvm::mca::RetireStage::notifyInstructionRetired().
|
inline |
Definition at line 214 of file LSUnit.h.
Referenced by onInstructionRetired().
|
inline |
Definition at line 215 of file LSUnit.h.
Referenced by onInstructionRetired().