LLVM 20.0.0git
|
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 (uint64_t ConsumedBuffers) const |
unsigned | resolveResourceMask (uint64_t Mask) const |
void | reserveBuffers (uint64_t ConsumedBuffers) |
void | releaseBuffers (uint64_t ConsumedBuffers) |
void | reserveResource (uint64_t ResourceID) |
void | releaseResource (uint64_t ResourceID) |
uint64_t | checkAvailability (const InstrDesc &Desc) const |
uint64_t | getProcResUnitMask () const |
uint64_t | getAvailableProcResUnits () const |
void | issueInstruction (const InstrDesc &Desc, SmallVectorImpl< std::pair< ResourceRef, ReleaseAtCycles > > &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 311 of file ResourceManager.h.
llvm::mca::ResourceManager::ResourceManager | ( | const MCSchedModel & | SM | ) |
Definition at line 111 of file ResourceManager.cpp.
References llvm::mca::computeProcResourceMasks(), E, llvm::MCSchedModel::getNumProcResourceKinds(), llvm::MCSchedModel::getProcResource(), llvm::mca::getResourceStateIndex(), llvm::mca::getStrategyFor(), I, and llvm::mca::ResourceState::isAResourceGroup().
|
virtualdefault |
ResourceStateEvent llvm::mca::ResourceManager::canBeDispatched | ( | uint64_t | ConsumedBuffers | ) | const |
Definition at line 245 of file ResourceManager.cpp.
References llvm::mca::RS_BUFFER_AVAILABLE, llvm::mca::RS_BUFFER_UNAVAILABLE, and llvm::mca::RS_RESERVED.
Definition at line 282 of file ResourceManager.cpp.
References llvm::bit_floor(), E, llvm::DenseMapBase< DerivedT, KeyT, ValueT, KeyInfoT, BucketT >::end(), llvm::DenseMapBase< DerivedT, KeyT, ValueT, KeyInfoT, BucketT >::find(), llvm::mca::ResourceState::getReadyMask(), llvm::mca::getResourceStateIndex(), llvm::DenseMapBase< DerivedT, KeyT, ValueT, KeyInfoT, BucketT >::insert(), llvm::mca::ResourceState::isAResourceGroup(), llvm::mca::ResourceState::isReady(), and llvm::popcount().
void llvm::mca::ResourceManager::cycleEvent | ( | SmallVectorImpl< ResourceRef > & | ResourcesFreed | ) |
Definition at line 374 of file ResourceManager.cpp.
References llvm::popcount(), llvm::SmallVectorTemplateBase< T, bool >::push_back(), llvm::release, and releaseResource().
Referenced by llvm::mca::InOrderIssueStage::cycleStart().
|
inline |
Definition at line 438 of file ResourceManager.h.
|
inline |
Definition at line 429 of file ResourceManager.h.
|
inline |
Definition at line 428 of file ResourceManager.h.
void llvm::mca::ResourceManager::issueInstruction | ( | const InstrDesc & | Desc, |
SmallVectorImpl< std::pair< ResourceRef, ReleaseAtCycles > > & | Pipes | ||
) |
Definition at line 347 of file ResourceManager.cpp.
References assert(), llvm::mca::CycleSegment::begin(), llvm::popcount(), releaseResource(), reserveResource(), llvm::mca::CycleSegment::size(), and use.
void llvm::mca::ResourceManager::releaseBuffers | ( | uint64_t | ConsumedBuffers | ) |
Definition at line 270 of file ResourceManager.cpp.
References llvm::mca::getResourceStateIndex().
void llvm::mca::ResourceManager::releaseResource | ( | uint64_t | ResourceID | ) |
Definition at line 402 of file ResourceManager.cpp.
References llvm::mca::ResourceState::clearReserved(), llvm::mca::getResourceStateIndex(), llvm::mca::ResourceState::isADispatchHazard(), and llvm::mca::ResourceState::isAResourceGroup().
Referenced by cycleEvent(), and issueInstruction().
void llvm::mca::ResourceManager::reserveBuffers | ( | uint64_t | ConsumedBuffers | ) |
Definition at line 253 of file ResourceManager.cpp.
References assert(), llvm::mca::getResourceStateIndex(), and llvm::mca::RS_BUFFER_AVAILABLE.
void llvm::mca::ResourceManager::reserveResource | ( | uint64_t | ResourceID | ) |
Definition at line 393 of file ResourceManager.cpp.
References assert(), llvm::mca::getResourceStateIndex(), llvm::mca::ResourceState::isAResourceGroup(), llvm::mca::ResourceState::isReserved(), and llvm::mca::ResourceState::setReserved().
Referenced by issueInstruction().
Definition at line 166 of file ResourceManager.cpp.
References llvm::mca::getResourceStateIndex().
|
inline |
Definition at line 391 of file ResourceManager.h.
References assert(), and llvm::SmallVectorBase< Size_T >::size().