LLVM 22.0.0git
|
A resource manager for processor resource units and groups. More...
#include "llvm/MCA/HardwareUnits/ResourceManager.h"
Public Types | |
using | ResourceWithCycles = std::pair< ResourceRef, ReleaseAtCycles > |
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 315 of file ResourceManager.h.
using llvm::mca::ResourceManager::ResourceWithCycles = std::pair<ResourceRef, ReleaseAtCycles> |
Definition at line 435 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, Index, 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::mca::ResourceState::getReadyMask(), llvm::mca::getResourceStateIndex(), Index, llvm::mca::ResourceState::isAResourceGroup(), llvm::mca::ResourceState::isReady(), llvm::popcount(), and llvm::DenseMapBase< DerivedT, KeyT, ValueT, KeyInfoT, BucketT >::try_emplace().
void llvm::mca::ResourceManager::cycleEvent | ( | SmallVectorImpl< ResourceRef > & | ResourcesFreed | ) |
Definition at line 454 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 467 of file ResourceManager.h.
void llvm::mca::ResourceManager::fastIssueInstruction | ( | const InstrDesc & | Desc, |
SmallVectorImpl< ResourceWithCycles > & | Pipes | ||
) |
Definition at line 428 of file ResourceManager.cpp.
References assert(), llvm::mca::CycleSegment::begin(), llvm::SmallVectorImpl< T >::emplace_back(), llvm::popcount(), releaseResource(), reserveResource(), llvm::mca::CycleSegment::size(), and use.
Referenced by issueInstruction().
|
inline |
Definition at line 433 of file ResourceManager.h.
|
inline |
Definition at line 432 of file ResourceManager.h.
|
inline |
Definition at line 437 of file ResourceManager.h.
References fastIssueInstruction(), and issueInstructionImpl().
void llvm::mca::ResourceManager::issueInstructionImpl | ( | const InstrDesc & | Desc, |
SmallVectorImpl< ResourceWithCycles > & | Pipes | ||
) |
Definition at line 346 of file ResourceManager.cpp.
References assert(), llvm::mca::CycleSegment::begin(), E, llvm::SmallVectorImpl< T >::emplace_back(), llvm::SmallVectorBase< Size_T >::empty(), llvm::mca::ResourceState::getNumReadyUnits(), llvm::mca::getResourceStateIndex(), I, llvm::mca::ResourceState::isAResourceGroup(), llvm::popcount(), llvm::SmallVectorTemplateBase< T, bool >::push_back(), releaseResource(), reserveResource(), llvm::SmallVectorBase< Size_T >::size(), llvm::mca::CycleSegment::size(), llvm::sort(), and use.
Referenced by issueInstruction().
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 482 of file ResourceManager.cpp.
References llvm::mca::ResourceState::clearReserved(), llvm::mca::getResourceStateIndex(), Index, llvm::mca::ResourceState::isADispatchHazard(), and llvm::mca::ResourceState::isAResourceGroup().
Referenced by cycleEvent(), fastIssueInstruction(), and issueInstructionImpl().
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 473 of file ResourceManager.cpp.
References assert(), llvm::mca::getResourceStateIndex(), Index, llvm::mca::ResourceState::isAResourceGroup(), llvm::mca::ResourceState::isReserved(), and llvm::mca::ResourceState::setReserved().
Referenced by fastIssueInstruction(), and issueInstructionImpl().
Definition at line 166 of file ResourceManager.cpp.
References llvm::mca::getResourceStateIndex().
|
inline |
Definition at line 395 of file ResourceManager.h.
References assert(), and llvm::SmallVectorBase< Size_T >::size().