Lines Matching refs:SU

309   virtual void schedNode(SUnit *SU, bool IsTopNode) = 0;
313 virtual void releaseTopNode(SUnit *SU) = 0;
316 virtual void releaseBottomNode(SUnit *SU) = 0;
426 void releaseSucc(SUnit *SU, SDep *SuccEdge);
427 void releaseSuccessors(SUnit *SU);
428 void releasePred(SUnit *SU, SDep *PredEdge);
429 void releasePredecessors(SUnit *SU);
439 void ScheduleDAGMI::releaseSucc(SUnit *SU, SDep *SuccEdge) {
455 /// releaseSuccessors - Call releaseSucc on each of SU's successors.
456 void ScheduleDAGMI::releaseSuccessors(SUnit *SU) {
457 for (SUnit::succ_iterator I = SU->Succs.begin(), E = SU->Succs.end();
459 releaseSucc(SU, &*I);
467 void ScheduleDAGMI::releasePred(SUnit *SU, SDep *PredEdge) {
483 /// releasePredecessors - Call releasePred on each of SU's predecessors.
484 void ScheduleDAGMI::releasePredecessors(SUnit *SU) {
485 for (SUnit::pred_iterator I = SU->Preds.begin(), E = SU->Preds.end();
487 releasePred(SU, &*I);
644 while (SUnit *SU = SchedImpl->pickNode(IsTopNode)) {
649 MachineInstr *MI = SU->getInstr();
652 assert(SU->isTopReady() && "node still has unscheduled dependencies");
666 releaseSuccessors(SU);
669 assert(SU->isBottomReady() && "node still has unscheduled dependencies");
688 releasePredecessors(SU);
690 SU->isScheduled = true;
691 SchedImpl->schedNode(SU, IsTopNode);
739 // SU is in this queue if it's NodeQueueID is a superset of this ID.
740 bool isInQueue(SUnit *SU) const { return (SU->NodeQueueId & ID); }
752 iterator find(SUnit *SU) {
753 return std::find(Queue.begin(), Queue.end(), SU);
756 void push(SUnit *SU) {
757 Queue.push_back(SU);
758 SU->NodeQueueId |= ID;
785 SUnit *SU;
790 SchedCandidate(): SU(NULL) {}
831 bool checkHazard(SUnit *SU);
833 void releaseNode(SUnit *SU, unsigned ReadyCycle);
837 void bumpNode(SUnit *SU);
841 void removeReady(SUnit *SU);
868 virtual void schedNode(SUnit *SU, bool IsTopNode);
870 virtual void releaseTopNode(SUnit *SU);
872 virtual void releaseBottomNode(SUnit *SU);
881 void traceCandidate(const char *Label, const ReadyQueue &Q, SUnit *SU,
903 void ConvergingScheduler::releaseTopNode(SUnit *SU) {
904 if (SU->isScheduled)
907 for (SUnit::succ_iterator I = SU->Preds.begin(), E = SU->Preds.end();
914 if (SU->TopReadyCycle < PredReadyCycle + MinLatency)
915 SU->TopReadyCycle = PredReadyCycle + MinLatency;
917 Top.releaseNode(SU, SU->TopReadyCycle);
920 void ConvergingScheduler::releaseBottomNode(SUnit *SU) {
921 if (SU->isScheduled)
924 assert(SU->getInstr() && "Scheduled SUnit must have instr");
926 for (SUnit::succ_iterator I = SU->Succs.begin(), E = SU->Succs.end();
933 if (SU->BotReadyCycle < SuccReadyCycle + MinLatency)
934 SU->BotReadyCycle = SuccReadyCycle + MinLatency;
936 Bot.releaseNode(SU, SU->BotReadyCycle);
939 /// Does this SU have a hazard within the current instruction group.
951 /// TODO: Also check whether the SU must start a new group.
952 bool ConvergingScheduler::SchedBoundary::checkHazard(SUnit *SU) {
954 return HazardRec->getHazardType(SU) != ScheduleHazardRecognizer::NoHazard;
956 if (IssueCount + DAG->getNumMicroOps(SU->getInstr()) > DAG->getIssueWidth())
962 void ConvergingScheduler::SchedBoundary::releaseNode(SUnit *SU,
969 if (ReadyCycle > CurrCycle || checkHazard(SU))
970 Pending.push(SU);
972 Available.push(SU);
1003 void ConvergingScheduler::SchedBoundary::bumpNode(SUnit *SU) {
1006 if (!isTop() && SU->isCall) {
1011 HazardRec->EmitInstruction(SU);
1014 // TODO: Check if this SU must end a dispatch group.
1015 IssueCount += DAG->getNumMicroOps(SU->getInstr());
1032 SUnit *SU = *(Pending.begin()+i);
1033 unsigned ReadyCycle = isTop() ? SU->TopReadyCycle : SU->BotReadyCycle;
1041 if (checkHazard(SU))
1044 Available.push(SU);
1051 /// Remove SU from the ready set for this boundary.
1052 void ConvergingScheduler::SchedBoundary::removeReady(SUnit *SU) {
1053 if (Available.isInQueue(SU))
1054 Available.remove(Available.find(SU));
1056 assert(Pending.isInQueue(SU) && "bad ready count");
1057 Pending.remove(Pending.find(SU));
1081 SUnit *SU, PressureElement P) {
1088 SU->dump(DAG);
1137 if (!Candidate.SU) {
1138 Candidate.SU = *I;
1146 Candidate.SU = *I;
1160 Candidate.SU = *I;
1175 Candidate.SU = *I;
1191 if ((Q.getID() == TopQID && (*I)->NodeNum < Candidate.SU->NodeNum)
1192 || (Q.getID() == BotQID && (*I)->NodeNum > Candidate.SU->NodeNum)) {
1194 Candidate.SU = *I;
1206 if (SUnit *SU = Bot.pickOnlyChoice()) {
1208 return SU;
1210 if (SUnit *SU = Top.pickOnlyChoice()) {
1212 return SU;
1229 return BotCand.SU;
1239 return TopCand.SU;
1245 return BotCand.SU;
1249 return TopCand.SU;
1254 return TopCand.SU;
1258 return BotCand.SU;
1268 SUnit *SU;
1270 SU = Top.pickOnlyChoice();
1271 if (!SU) {
1277 SU = TopCand.SU;
1282 SU = Bot.pickOnlyChoice();
1283 if (!SU) {
1289 SU = BotCand.SU;
1294 SU = pickNodeBidrectional(IsTopNode);
1296 if (SU->isTopReady())
1297 Top.removeReady(SU);
1298 if (SU->isBottomReady())
1299 Bot.removeReady(SU);
1304 SU->dump(DAG));
1305 return SU;
1311 void ConvergingScheduler::schedNode(SUnit *SU, bool IsTopNode) {
1313 SU->TopReadyCycle = Top.CurrCycle;
1314 Top.bumpNode(SU);
1317 SU->BotReadyCycle = Bot.CurrCycle;
1318 Bot.bumpNode(SU);
1377 SUnit *SU;
1381 SU = TopQ.top();
1383 } while (SU->isScheduled);
1389 SU = BottomQ.top();
1391 } while (SU->isScheduled);
1396 return SU;
1399 virtual void schedNode(SUnit *SU, bool IsTopNode) {}
1401 virtual void releaseTopNode(SUnit *SU) {
1402 TopQ.push(SU);
1404 virtual void releaseBottomNode(SUnit *SU) {
1405 BottomQ.push(SU);