mirror of
https://github.com/RPCS3/llvm.git
synced 2024-12-02 16:56:39 +00:00
[MCA] Use references to LSUnitBase in class Scheduler and add helper methods to acquire/release LS queue entries. NFCI
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@373236 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
1cffa20e9d
commit
f49c8ae0e5
@ -209,8 +209,10 @@ public:
|
||||
|
||||
unsigned getUsedLQEntries() const { return UsedLQEntries; }
|
||||
unsigned getUsedSQEntries() const { return UsedSQEntries; }
|
||||
unsigned assignLQSlot() { return UsedLQEntries++; }
|
||||
unsigned assignSQSlot() { return UsedSQEntries++; }
|
||||
void acquireLQSlot() { ++UsedLQEntries; }
|
||||
void acquireSQSlot() { ++UsedSQEntries; }
|
||||
void releaseLQSlot() { --UsedLQEntries; }
|
||||
void releaseSQSlot() { --UsedSQEntries; }
|
||||
|
||||
bool assumeNoAlias() const { return NoAlias; }
|
||||
|
||||
|
@ -68,7 +68,7 @@ public:
|
||||
/// instructions from the dispatch stage, until the write-back stage.
|
||||
///
|
||||
class Scheduler : public HardwareUnit {
|
||||
LSUnit &LSU;
|
||||
LSUnitBase &LSU;
|
||||
|
||||
// Instruction selection strategy for this Scheduler.
|
||||
std::unique_ptr<SchedulerStrategy> Strategy;
|
||||
@ -154,15 +154,15 @@ class Scheduler : public HardwareUnit {
|
||||
bool promoteToPendingSet(SmallVectorImpl<InstRef> &Pending);
|
||||
|
||||
public:
|
||||
Scheduler(const MCSchedModel &Model, LSUnit &Lsu)
|
||||
Scheduler(const MCSchedModel &Model, LSUnitBase &Lsu)
|
||||
: Scheduler(Model, Lsu, nullptr) {}
|
||||
|
||||
Scheduler(const MCSchedModel &Model, LSUnit &Lsu,
|
||||
Scheduler(const MCSchedModel &Model, LSUnitBase &Lsu,
|
||||
std::unique_ptr<SchedulerStrategy> SelectStrategy)
|
||||
: Scheduler(std::make_unique<ResourceManager>(Model), Lsu,
|
||||
std::move(SelectStrategy)) {}
|
||||
|
||||
Scheduler(std::unique_ptr<ResourceManager> RM, LSUnit &Lsu,
|
||||
Scheduler(std::unique_ptr<ResourceManager> RM, LSUnitBase &Lsu,
|
||||
std::unique_ptr<SchedulerStrategy> SelectStrategy)
|
||||
: LSU(Lsu), Resources(std::move(RM)), BusyResourceUnits(0),
|
||||
NumDispatchedToThePendingSet(0), HadTokenStall(false) {
|
||||
|
@ -72,9 +72,9 @@ unsigned LSUnit::dispatch(const InstRef &IR) {
|
||||
assert((Desc.MayLoad || Desc.MayStore) && "Not a memory operation!");
|
||||
|
||||
if (Desc.MayLoad)
|
||||
assignLQSlot();
|
||||
acquireLQSlot();
|
||||
if (Desc.MayStore)
|
||||
assignSQSlot();
|
||||
acquireSQSlot();
|
||||
|
||||
if (Desc.MayStore) {
|
||||
// Always create a new group for store operations.
|
||||
@ -173,13 +173,13 @@ void LSUnitBase::onInstructionExecuted(const InstRef &IR) {
|
||||
}
|
||||
|
||||
if (IsALoad) {
|
||||
UsedLQEntries--;
|
||||
releaseLQSlot();
|
||||
LLVM_DEBUG(dbgs() << "[LSUnit]: Instruction idx=" << IR.getSourceIndex()
|
||||
<< " has been removed from the load queue.\n");
|
||||
}
|
||||
|
||||
if (IsAStore) {
|
||||
UsedSQEntries--;
|
||||
releaseSQSlot();
|
||||
LLVM_DEBUG(dbgs() << "[LSUnit]: Instruction idx=" << IR.getSourceIndex()
|
||||
<< " has been removed from the store queue.\n");
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user