mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2025-04-13 04:52:50 +00:00
Changed CPUResource to allow access to maxnum users.
llvm-svn: 13425
This commit is contained in:
parent
57339f67d6
commit
b6ecf521da
@ -14,13 +14,25 @@
|
|||||||
|
|
||||||
#include "llvm/Target/TargetSchedInfo.h"
|
#include "llvm/Target/TargetSchedInfo.h"
|
||||||
#include "llvm/Target/TargetMachine.h"
|
#include "llvm/Target/TargetMachine.h"
|
||||||
|
#include <iostream>
|
||||||
|
using namespace llvm;
|
||||||
|
|
||||||
namespace llvm {
|
resourceId_t llvm::CPUResource::nextId = 0;
|
||||||
|
static std::vector<CPUResource*> *CPUResourceMap = 0;
|
||||||
resourceId_t CPUResource::nextId = 0;
|
|
||||||
|
|
||||||
CPUResource::CPUResource(const std::string& resourceName, int maxUsers)
|
CPUResource::CPUResource(const std::string& resourceName, int maxUsers)
|
||||||
: rname(resourceName), rid(nextId++), maxNumUsers(maxUsers) {}
|
: rname(resourceName), rid(nextId++), maxNumUsers(maxUsers) {
|
||||||
|
if(!CPUResourceMap)
|
||||||
|
CPUResourceMap = new std::vector<CPUResource*>;
|
||||||
|
|
||||||
|
//Put Resource in the map
|
||||||
|
CPUResourceMap->push_back(this);
|
||||||
|
}
|
||||||
|
|
||||||
|
///Get CPUResource if you only have the resource ID
|
||||||
|
CPUResource* CPUResource::getCPUResource(resourceId_t id) {
|
||||||
|
return (*CPUResourceMap)[id];
|
||||||
|
}
|
||||||
|
|
||||||
// Check if fromRVec and toRVec have *any* common entries.
|
// Check if fromRVec and toRVec have *any* common entries.
|
||||||
// Assume the vectors are sorted in increasing order.
|
// Assume the vectors are sorted in increasing order.
|
||||||
@ -254,5 +266,3 @@ void InstrRUsage::addUsageDelta(const InstrRUsageDelta &delta) {
|
|||||||
assert(r >= 0 && "Resource to remove was unused in cycle c!");
|
assert(r >= 0 && "Resource to remove was unused in cycle c!");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
} // End llvm namespace
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user