mirror of
https://github.com/RPCSX/llvm.git
synced 2025-02-04 19:38:22 +00:00
misched: count micro-ops toward the issue limit.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@159407 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
0d9513c74f
commit
7f8c74cfae
@ -313,13 +313,13 @@ public:
|
|||||||
return UseCycle;
|
return UseCycle;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// isMicroCoded - Return true if the instructions in the given class decode
|
/// getNumMicroOps - Return the number of micro-ops that the given class
|
||||||
/// to more than one micro-ops.
|
/// decodes to. Return -1 for classes that require dynamic lookup via
|
||||||
bool isMicroCoded(unsigned ItinClassIndx) const {
|
/// TargetInstrInfo.
|
||||||
|
int getNumMicroOps(unsigned ItinClassIndx) const {
|
||||||
if (isEmpty())
|
if (isEmpty())
|
||||||
return false;
|
return 1;
|
||||||
int UOps = Itineraries[ItinClassIndx].NumMicroOps;
|
return Itineraries[ItinClassIndx].NumMicroOps;
|
||||||
return UOps < 0 || UOps > 1;
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -402,11 +402,16 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// getIssueWidth - Return the max instructions per scheduling group.
|
/// getIssueWidth - Return the max instructions per scheduling group.
|
||||||
///
|
|
||||||
unsigned getIssueWidth() const {
|
unsigned getIssueWidth() const {
|
||||||
return InstrItins ? InstrItins->Props.IssueWidth : 1;
|
return InstrItins ? InstrItins->Props.IssueWidth : 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// getNumMicroOps - Return the number of issue slots required for this MI.
|
||||||
|
unsigned getNumMicroOps(MachineInstr *MI) const {
|
||||||
|
int UOps = InstrItins->getNumMicroOps(MI->getDesc().getSchedClass());
|
||||||
|
return (UOps >= 0) ? UOps : TII->getNumMicroOps(InstrItins, MI);
|
||||||
|
}
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
void initRegPressure();
|
void initRegPressure();
|
||||||
void updateScheduledPressure(std::vector<unsigned> NewMaxPressure);
|
void updateScheduledPressure(std::vector<unsigned> NewMaxPressure);
|
||||||
@ -788,6 +793,8 @@ class ConvergingScheduler : public MachineSchedStrategy {
|
|||||||
/// current cycle in whichever direction at has moved, and maintains the state
|
/// current cycle in whichever direction at has moved, and maintains the state
|
||||||
/// of "hazards" and other interlocks at the current cycle.
|
/// of "hazards" and other interlocks at the current cycle.
|
||||||
struct SchedBoundary {
|
struct SchedBoundary {
|
||||||
|
ScheduleDAGMI *DAG;
|
||||||
|
|
||||||
ReadyQueue Available;
|
ReadyQueue Available;
|
||||||
ReadyQueue Pending;
|
ReadyQueue Pending;
|
||||||
bool CheckPending;
|
bool CheckPending;
|
||||||
@ -806,7 +813,7 @@ class ConvergingScheduler : public MachineSchedStrategy {
|
|||||||
/// Pending queues extend the ready queues with the same ID and the
|
/// Pending queues extend the ready queues with the same ID and the
|
||||||
/// PendingFlag set.
|
/// PendingFlag set.
|
||||||
SchedBoundary(unsigned ID, const Twine &Name):
|
SchedBoundary(unsigned ID, const Twine &Name):
|
||||||
Available(ID, Name+".A"),
|
DAG(0), Available(ID, Name+".A"),
|
||||||
Pending(ID << ConvergingScheduler::LogMaxQID, Name+".P"),
|
Pending(ID << ConvergingScheduler::LogMaxQID, Name+".P"),
|
||||||
CheckPending(false), HazardRec(0), CurrCycle(0), IssueCount(0),
|
CheckPending(false), HazardRec(0), CurrCycle(0), IssueCount(0),
|
||||||
MinReadyCycle(UINT_MAX), MaxMinLatency(0) {}
|
MinReadyCycle(UINT_MAX), MaxMinLatency(0) {}
|
||||||
@ -821,7 +828,7 @@ class ConvergingScheduler : public MachineSchedStrategy {
|
|||||||
|
|
||||||
void bumpCycle();
|
void bumpCycle();
|
||||||
|
|
||||||
void bumpNode(SUnit *SU, unsigned IssueWidth);
|
void bumpNode(SUnit *SU);
|
||||||
|
|
||||||
void releasePending();
|
void releasePending();
|
||||||
|
|
||||||
@ -874,6 +881,8 @@ protected:
|
|||||||
void ConvergingScheduler::initialize(ScheduleDAGMI *dag) {
|
void ConvergingScheduler::initialize(ScheduleDAGMI *dag) {
|
||||||
DAG = dag;
|
DAG = dag;
|
||||||
TRI = DAG->TRI;
|
TRI = DAG->TRI;
|
||||||
|
Top.DAG = dag;
|
||||||
|
Bot.DAG = dag;
|
||||||
|
|
||||||
// Initialize the HazardRecognizers.
|
// Initialize the HazardRecognizers.
|
||||||
const TargetMachine &TM = DAG->MF.getTarget();
|
const TargetMachine &TM = DAG->MF.getTarget();
|
||||||
@ -940,7 +949,8 @@ void ConvergingScheduler::SchedBoundary::releaseNode(SUnit *SU,
|
|||||||
|
|
||||||
/// Move the boundary of scheduled code by one cycle.
|
/// Move the boundary of scheduled code by one cycle.
|
||||||
void ConvergingScheduler::SchedBoundary::bumpCycle() {
|
void ConvergingScheduler::SchedBoundary::bumpCycle() {
|
||||||
IssueCount = 0;
|
unsigned Width = DAG->getIssueWidth();
|
||||||
|
IssueCount = (IssueCount <= Width) ? 0 : IssueCount - Width;
|
||||||
|
|
||||||
assert(MinReadyCycle < UINT_MAX && "MinReadyCycle uninitialized");
|
assert(MinReadyCycle < UINT_MAX && "MinReadyCycle uninitialized");
|
||||||
unsigned NextCycle = std::max(CurrCycle + 1, MinReadyCycle);
|
unsigned NextCycle = std::max(CurrCycle + 1, MinReadyCycle);
|
||||||
@ -965,8 +975,7 @@ void ConvergingScheduler::SchedBoundary::bumpCycle() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// Move the boundary of scheduled code by one SUnit.
|
/// Move the boundary of scheduled code by one SUnit.
|
||||||
void ConvergingScheduler::SchedBoundary::bumpNode(SUnit *SU,
|
void ConvergingScheduler::SchedBoundary::bumpNode(SUnit *SU) {
|
||||||
unsigned IssueWidth) {
|
|
||||||
// Update the reservation table.
|
// Update the reservation table.
|
||||||
if (HazardRec->isEnabled()) {
|
if (HazardRec->isEnabled()) {
|
||||||
if (!isTop() && SU->isCall) {
|
if (!isTop() && SU->isCall) {
|
||||||
@ -977,8 +986,8 @@ void ConvergingScheduler::SchedBoundary::bumpNode(SUnit *SU,
|
|||||||
HazardRec->EmitInstruction(SU);
|
HazardRec->EmitInstruction(SU);
|
||||||
}
|
}
|
||||||
// Check the instruction group size limit.
|
// Check the instruction group size limit.
|
||||||
++IssueCount;
|
IssueCount += DAG->getNumMicroOps(SU->getInstr());
|
||||||
if (IssueCount == IssueWidth) {
|
if (IssueCount >= DAG->getIssueWidth()) {
|
||||||
DEBUG(dbgs() << "*** Max instrs at cycle " << CurrCycle << '\n');
|
DEBUG(dbgs() << "*** Max instrs at cycle " << CurrCycle << '\n');
|
||||||
bumpCycle();
|
bumpCycle();
|
||||||
}
|
}
|
||||||
@ -1277,11 +1286,11 @@ SUnit *ConvergingScheduler::pickNode(bool &IsTopNode) {
|
|||||||
void ConvergingScheduler::schedNode(SUnit *SU, bool IsTopNode) {
|
void ConvergingScheduler::schedNode(SUnit *SU, bool IsTopNode) {
|
||||||
if (IsTopNode) {
|
if (IsTopNode) {
|
||||||
SU->TopReadyCycle = Top.CurrCycle;
|
SU->TopReadyCycle = Top.CurrCycle;
|
||||||
Top.bumpNode(SU, DAG->getIssueWidth());
|
Top.bumpNode(SU);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
SU->BotReadyCycle = Bot.CurrCycle;
|
SU->BotReadyCycle = Bot.CurrCycle;
|
||||||
Bot.bumpNode(SU, DAG->getIssueWidth());
|
Bot.bumpNode(SU);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user