#include "llvm/MCA/HardwareUnits/Scheduler.h"
#include "llvm/Support/Debug.h"
#include "llvm/Support/raw_ostream.h"
namespace llvm {
namespace mca {
#define DEBUG_TYPE …
void Scheduler::initializeStrategy(std::unique_ptr<SchedulerStrategy> S) { … }
SchedulerStrategy::~SchedulerStrategy() = default;
DefaultSchedulerStrategy::~DefaultSchedulerStrategy() = default;
#ifndef NDEBUG
void Scheduler::dump() const {
dbgs() << "[SCHEDULER]: WaitSet size is: " << WaitSet.size() << '\n';
dbgs() << "[SCHEDULER]: ReadySet size is: " << ReadySet.size() << '\n';
dbgs() << "[SCHEDULER]: IssuedSet size is: " << IssuedSet.size() << '\n';
Resources->dump();
}
#endif
Scheduler::Status Scheduler::isAvailable(const InstRef &IR) { … }
void Scheduler::issueInstructionImpl(
InstRef &IR,
SmallVectorImpl<std::pair<ResourceRef, ReleaseAtCycles>> &UsedResources) { … }
void Scheduler::issueInstruction(
InstRef &IR,
SmallVectorImpl<std::pair<ResourceRef, ReleaseAtCycles>> &UsedResources,
SmallVectorImpl<InstRef> &PendingInstructions,
SmallVectorImpl<InstRef> &ReadyInstructions) { … }
bool Scheduler::promoteToReadySet(SmallVectorImpl<InstRef> &Ready) { … }
bool Scheduler::promoteToPendingSet(SmallVectorImpl<InstRef> &Pending) { … }
InstRef Scheduler::select() { … }
void Scheduler::updateIssuedSet(SmallVectorImpl<InstRef> &Executed) { … }
uint64_t Scheduler::analyzeResourcePressure(SmallVectorImpl<InstRef> &Insts) { … }
void Scheduler::analyzeDataDependencies(SmallVectorImpl<InstRef> &RegDeps,
SmallVectorImpl<InstRef> &MemDeps) { … }
void Scheduler::cycleEvent(SmallVectorImpl<ResourceRef> &Freed,
SmallVectorImpl<InstRef> &Executed,
SmallVectorImpl<InstRef> &Pending,
SmallVectorImpl<InstRef> &Ready) { … }
bool Scheduler::mustIssueImmediately(const InstRef &IR) const { … }
bool Scheduler::dispatch(InstRef &IR) { … }
}
}