• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /macosx-10.10/llvmCore-3425.0.34/lib/Target/Hexagon/

Lines Matching refs:SU

39 /// Check if scheduling of this SU is possible
44 bool VLIWResourceModel::isResourceAvailable(SUnit *SU) {
45 if (!SU || !SU->getInstr())
50 switch (SU->getInstr()->getOpcode()) {
52 if (!ResourcesModel->canReserveResources(SU->getInstr()))
76 if (I->getSUnit() == SU)
84 bool VLIWResourceModel::reserveResources(SUnit *SU) {
87 if (!SU) {
93 // If this SU does not fit in the packet
95 if (!isResourceAvailable(SU)) {
102 switch (SU->getInstr()->getOpcode()) {
104 ResourcesModel->reserveResources(SU->getInstr());
118 Packet.push_back(SU);
123 DEBUG(dbgs() << "\t[" << i << "] SU(");
174 while (SUnit *SU = SchedImpl->pickNode(IsTopNode)) {
178 scheduleMI(SU, IsTopNode);
180 updateQueues(SU, IsTopNode);
208 void ConvergingVLIWScheduler::releaseTopNode(SUnit *SU) {
209 if (SU->isScheduled)
212 for (SUnit::succ_iterator I = SU->Preds.begin(), E = SU->Preds.end();
219 if (SU->TopReadyCycle < PredReadyCycle + MinLatency)
220 SU->TopReadyCycle = PredReadyCycle + MinLatency;
222 Top.releaseNode(SU, SU->TopReadyCycle);
225 void ConvergingVLIWScheduler::releaseBottomNode(SUnit *SU) {
226 if (SU->isScheduled)
229 assert(SU->getInstr() && "Scheduled SUnit must have instr");
231 for (SUnit::succ_iterator I = SU->Succs.begin(), E = SU->Succs.end();
238 if (SU->BotReadyCycle < SuccReadyCycle + MinLatency)
239 SU->BotReadyCycle = SuccReadyCycle + MinLatency;
241 Bot.releaseNode(SU, SU->BotReadyCycle);
244 /// Does this SU have a hazard within the current instruction group.
256 /// TODO: Also check whether the SU must start a new group.
257 bool ConvergingVLIWScheduler::SchedBoundary::checkHazard(SUnit *SU) {
259 return HazardRec->getHazardType(SU) != ScheduleHazardRecognizer::NoHazard;
261 unsigned uops = SchedModel->getNumMicroOps(SU->getInstr());
268 void ConvergingVLIWScheduler::SchedBoundary::releaseNode(SUnit *SU,
275 if (ReadyCycle > CurrCycle || checkHazard(SU))
277 Pending.push(SU);
279 Available.push(SU);
309 void ConvergingVLIWScheduler::SchedBoundary::bumpNode(SUnit *SU) {
314 if (!isTop() && SU->isCall) {
319 HazardRec->EmitInstruction(SU);
323 startNewCycle = ResourceModel->reserveResources(SU);
326 // TODO: Check if this SU must end a dispatch group.
327 IssueCount += SchedModel->getNumMicroOps(SU->getInstr());
347 SUnit *SU = *(Pending.begin()+i);
348 unsigned ReadyCycle = isTop() ? SU->TopReadyCycle : SU->BotReadyCycle;
356 if (checkHazard(SU))
359 Available.push(SU);
366 /// Remove SU from the ready set for this boundary.
367 void ConvergingVLIWScheduler::SchedBoundary::removeReady(SUnit *SU) {
368 if (Available.isInQueue(SU))
369 Available.remove(Available.find(SU));
371 assert(Pending.isInQueue(SU) && "bad ready count");
372 Pending.remove(Pending.find(SU));
398 SUnit *SU, PressureElement P) {
405 SU->dump(DAG);
410 /// of SU, return it, otherwise return null.
411 static SUnit *getSingleUnscheduledPred(SUnit *SU) {
413 for (SUnit::const_pred_iterator I = SU->Preds.begin(), E = SU->Preds.end();
428 /// of SU, return it, otherwise return null.
429 static SUnit *getSingleUnscheduledSucc(SUnit *SU) {
431 for (SUnit::const_succ_iterator I = SU->Succs.begin(), E = SU->Succs.end();
456 int ConvergingVLIWScheduler::SchedulingCost(ReadyQueue &Q, SUnit *SU,
464 if (!SU || SU->isScheduled)
468 if (SU->isScheduleHigh)
473 ResCount += (SU->getHeight() * ScaleTwo);
477 if (Top.ResourceModel->isResourceAvailable(SU))
480 ResCount += (SU->getDepth() * ScaleTwo);
484 if (Bot.ResourceModel->isResourceAvailable(SU))
494 for (SUnit::const_succ_iterator I = SU->Succs.begin(), E = SU->Succs.end();
496 if (getSingleUnscheduledPred(I->getSUnit()) == SU)
500 for (SUnit::const_pred_iterator I = SU->Preds.begin(), E = SU->Preds.end();
502 if (getSingleUnscheduledSucc(I->getSUnit()) == SU)
540 if (!Candidate.SU) {
541 Candidate.SU = *I;
551 Candidate.SU = *I;
570 if (SUnit *SU = Bot.pickOnlyChoice()) {
572 return SU;
574 if (SUnit *SU = Top.pickOnlyChoice()) {
576 return SU;
593 return BotCand.SU;
603 return TopCand.SU;
609 return BotCand.SU;
613 return TopCand.SU;
617 return TopCand.SU;
621 return BotCand.SU;
631 SUnit *SU;
633 SU = Top.pickOnlyChoice();
634 if (!SU) {
640 SU = TopCand.SU;
644 SU = Bot.pickOnlyChoice();
645 if (!SU) {
651 SU = BotCand.SU;
655 SU = pickNodeBidrectional(IsTopNode);
657 if (SU->isTopReady())
658 Top.removeReady(SU);
659 if (SU->isBottomReady())
660 Bot.removeReady(SU);
665 SU->dump(DAG));
666 return SU;
673 void ConvergingVLIWScheduler::schedNode(SUnit *SU, bool IsTopNode) {
675 SU->TopReadyCycle = Top.CurrCycle;
676 Top.bumpNode(SU);
678 SU->BotReadyCycle = Bot.CurrCycle;
679 Bot.bumpNode(SU);