diff options
author | Andrea Di Biagio <Andrea_DiBiagio@sn.scee.net> | 2018-03-10 16:55:07 +0000 |
---|---|---|
committer | Andrea Di Biagio <Andrea_DiBiagio@sn.scee.net> | 2018-03-10 16:55:07 +0000 |
commit | 0c54129907191f44780af22582da18ea4cf2a57e (patch) | |
tree | aa3786495c4ea061c1a0db9c9a1a6efaf9d1c103 /llvm/tools/llvm-mca/Scheduler.cpp | |
parent | 8224241f757c57fcb6696264ca3ae66a9e82de9a (diff) | |
download | bcm5719-llvm-0c54129907191f44780af22582da18ea4cf2a57e.tar.gz bcm5719-llvm-0c54129907191f44780af22582da18ea4cf2a57e.zip |
[llvm-mca] Views are now independent from resource masks. NFCI
This change removes method Backend::getProcResourceMasks() and simplifies some
logic in the Views. This effectively removes yet another dependency between the
views and the Backend.
No functional change intended.
llvm-svn: 327214
Diffstat (limited to 'llvm/tools/llvm-mca/Scheduler.cpp')
-rw-r--r-- | llvm/tools/llvm-mca/Scheduler.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/llvm/tools/llvm-mca/Scheduler.cpp b/llvm/tools/llvm-mca/Scheduler.cpp index 6c0c44bd4d7..26e806d88c1 100644 --- a/llvm/tools/llvm-mca/Scheduler.cpp +++ b/llvm/tools/llvm-mca/Scheduler.cpp @@ -46,9 +46,10 @@ void ResourceState::dump() const { // ResourceDescriptor. Map 'Resources' allows to quickly obtain ResourceState // objects from resource mask identifiers. void ResourceManager::addResource(const MCProcResourceDesc &Desc, + unsigned Index, uint64_t Mask) { assert(Resources.find(Mask) == Resources.end() && "Resource already added!"); - Resources[Mask] = llvm::make_unique<ResourceState>(Desc, Mask); + Resources[Mask] = llvm::make_unique<ResourceState>(Desc, Index, Mask); } // Populate vector ProcResID2Mask with resource masks. One per each processor @@ -219,6 +220,9 @@ void ResourceManager::issueInstruction( ResourceRef Pipe = selectPipe(R.first); use(Pipe); BusyResources[Pipe] += CS.size(); + // Replace the resource mask with a valid processor resource index. + const ResourceState &RS = *Resources[Pipe.first]; + Pipe.first = RS.getProcResourceID(); Pipes.emplace_back(std::pair<ResourceRef, unsigned>(Pipe, CS.size())); } else { assert((countPopulation(R.first) > 1) && "Expected a group!"); |