LLVM
8.0.1
|
A resource manager for processor resource units and groups. More...
#include "llvm/MCA/HardwareUnits/ResourceManager.h"
Public Member Functions | |
ResourceManager (const MCSchedModel &SM) | |
virtual | ~ResourceManager ()=default |
void | setCustomStrategy (std::unique_ptr< ResourceStrategy > S, unsigned ResourceID) |
ResourceStateEvent | canBeDispatched (ArrayRef< uint64_t > Buffers) const |
unsigned | resolveResourceMask (uint64_t Mask) const |
void | reserveBuffers (ArrayRef< uint64_t > Buffers) |
void | releaseBuffers (ArrayRef< uint64_t > Buffers) |
void | reserveResource (uint64_t ResourceID) |
void | releaseResource (uint64_t ResourceID) |
bool | canBeIssued (const InstrDesc &Desc) const |
void | issueInstruction (const InstrDesc &Desc, SmallVectorImpl< std::pair< ResourceRef, ResourceCycles >> &Pipes) |
void | cycleEvent (SmallVectorImpl< ResourceRef > &ResourcesFreed) |
void | dump () const |
A resource manager for processor resource units and groups.
This class owns all the ResourceState objects, and it is responsible for acting on requests from a Scheduler by updating the internal state of ResourceState objects. This class doesn't know about instruction itineraries and functional units. In future, it can be extended to support itineraries too through the same public interface.
Definition at line 304 of file ResourceManager.h.
llvm::mca::ResourceManager::ResourceManager | ( | const MCSchedModel & | SM | ) |
Definition at line 118 of file ResourceManager.cpp.
References assert(), llvm::mca::computeProcResourceMasks(), E, llvm::MCSchedModel::getNumProcResourceKinds(), llvm::MCSchedModel::getProcResource(), llvm::mca::getResourceStateIndex(), llvm::mca::getStrategyFor(), I, llvm::mca::ResourceState::isAResourceGroup(), llvm::BitmaskEnumDetail::Mask(), and Unit.
|
virtualdefault |
ResourceStateEvent llvm::mca::ResourceManager::canBeDispatched | ( | ArrayRef< uint64_t > | Buffers | ) | const |
Definition at line 234 of file ResourceManager.cpp.
References llvm::mca::getResourceStateIndex(), llvm::mca::ResourceState::isBufferAvailable(), and llvm::mca::RS_BUFFER_AVAILABLE.
Definition at line 263 of file ResourceManager.cpp.
References llvm::all_of(), E, and llvm::mca::InstrDesc::Resources.
void llvm::mca::ResourceManager::cycleEvent | ( | SmallVectorImpl< ResourceRef > & | ResourcesFreed | ) |
Definition at line 299 of file ResourceManager.cpp.
References llvm::ISD::BR, llvm::countPopulation(), llvm::SmallVectorTemplateBase< T >::push_back(), and releaseResource().
|
inline |
Definition at line 401 of file ResourceManager.h.
void llvm::mca::ResourceManager::issueInstruction | ( | const InstrDesc & | Desc, |
SmallVectorImpl< std::pair< ResourceRef, ResourceCycles >> & | Pipes | ||
) |
Definition at line 272 of file ResourceManager.cpp.
References assert(), llvm::mca::CycleSegment::begin(), llvm::countPopulation(), releaseResource(), reserveResource(), llvm::mca::InstrDesc::Resources, and llvm::mca::CycleSegment::size().
void llvm::mca::ResourceManager::releaseBuffers | ( | ArrayRef< uint64_t > | Buffers | ) |
Definition at line 258 of file ResourceManager.cpp.
References llvm::mca::getResourceStateIndex().
void llvm::mca::ResourceManager::releaseResource | ( | uint64_t | ResourceID | ) |
Definition at line 325 of file ResourceManager.cpp.
References llvm::mca::ResourceState::clearReserved(), and llvm::mca::getResourceStateIndex().
Referenced by cycleEvent(), and issueInstruction().
void llvm::mca::ResourceManager::reserveBuffers | ( | ArrayRef< uint64_t > | Buffers | ) |
Definition at line 245 of file ResourceManager.cpp.
References assert(), llvm::mca::getResourceStateIndex(), llvm::mca::ResourceState::isADispatchHazard(), llvm::mca::ResourceState::isBufferAvailable(), llvm::mca::ResourceState::isReserved(), llvm::mca::ResourceState::reserveBuffer(), llvm::mca::RS_BUFFER_AVAILABLE, and llvm::mca::ResourceState::setReserved().
void llvm::mca::ResourceManager::reserveResource | ( | uint64_t | ResourceID | ) |
Definition at line 319 of file ResourceManager.cpp.
References assert(), llvm::mca::getResourceStateIndex(), llvm::mca::ResourceState::isReserved(), and llvm::mca::ResourceState::setReserved().
Referenced by issueInstruction().
unsigned llvm::mca::ResourceManager::resolveResourceMask | ( | uint64_t | Mask | ) | const |
Definition at line 160 of file ResourceManager.cpp.
References assert(), llvm::mca::ResourceState::containsResource(), llvm::mca::ResourceState::getNumUnits(), llvm::mca::ResourceState::getResourceMask(), llvm::mca::getResourceStateIndex(), llvm::mca::ResourceState::isAResourceGroup(), llvm::mca::ResourceState::isReady(), llvm::mca::ResourceState::markSubResourceAsUsed(), llvm::mca::ResourceState::releaseSubResource(), and Users.
|
inline |
Definition at line 364 of file ResourceManager.h.
References assert(), llvm::BitmaskEnumDetail::Mask(), and llvm::SmallVectorBase::size().