Lines Matching refs:SU
178 void SIScheduleBlock::addUnit(SUnit *SU) { in addUnit() argument
179 NodeNum2Index[SU->NodeNum] = SUnits.size(); in addUnit()
180 SUnits.push_back(SU); in addUnit()
187 dbgs() << " SU(" << Cand.SU->NodeNum << ") " << getReasonStr(Cand.Reason); in traceCandidate()
237 if (TryCand.SU->NodeNum < Cand.SU->NodeNum) { in tryCandidateTopDown()
245 for (SUnit* SU : TopReadySUs) { in pickNode()
250 TryCand.SU = SU; in pickNode()
251 TopRPTracker.getDownwardPressure(SU->getInstr(), pressure, MaxPressure); in pickNode()
254 TryCand.IsLowLatency = DAG->IsLowLatencySU[SU->NodeNum]; in pickNode()
255 TryCand.LowLatencyOffset = DAG->LowLatencyOffset[SU->NodeNum]; in pickNode()
257 HasLowLatencyNonWaitedParent[NodeNum2Index[SU->NodeNum]]; in pickNode()
263 return TopCand.SU; in pickNode()
273 for (SUnit* SU : SUnits) { in fastSchedule()
274 if (!SU->NumPredsLeft) in fastSchedule()
275 TopReadySUs.push_back(SU); in fastSchedule()
279 SUnit *SU = TopReadySUs[0]; in fastSchedule() local
280 ScheduledSUnits.push_back(SU); in fastSchedule()
281 nodeScheduled(SU); in fastSchedule()
317 for (SUnit* SU : ScheduledSUnits) { in initRegPressure()
318 RPTracker.setPos(SU->getInstr()); in initRegPressure()
391 for (SUnit* SU : SUnits) { in schedule()
392 if (!SU->NumPredsLeft) in schedule()
393 TopReadySUs.push_back(SU); in schedule()
397 SUnit *SU = pickNode(); in schedule() local
398 ScheduledSUnits.push_back(SU); in schedule()
399 TopRPTracker.setPos(SU->getInstr()); in schedule()
401 nodeScheduled(SU); in schedule()
411 for (SUnit* SU : SUnits) { in schedule()
412 assert(SU->isScheduled && in schedule()
413 SU->NumPredsLeft == 0); in schedule()
421 for (SUnit* SU : SUnits) { in undoSchedule()
422 SU->isScheduled = false; in undoSchedule()
423 for (SDep& Succ : SU->Succs) { in undoSchedule()
425 undoReleaseSucc(SU, &Succ); in undoSchedule()
433 void SIScheduleBlock::undoReleaseSucc(SUnit *SU, SDep *SuccEdge) { in undoReleaseSucc() argument
443 void SIScheduleBlock::releaseSucc(SUnit *SU, SDep *SuccEdge) { in releaseSucc() argument
463 void SIScheduleBlock::releaseSuccessors(SUnit *SU, bool InOrOutBlock) { in releaseSuccessors() argument
464 for (SDep& Succ : SU->Succs) { in releaseSuccessors()
470 releaseSucc(SU, &Succ); in releaseSuccessors()
476 void SIScheduleBlock::nodeScheduled(SUnit *SU) { in nodeScheduled() argument
478 assert (!SU->NumPredsLeft); in nodeScheduled()
480 std::find(TopReadySUs.begin(), TopReadySUs.end(), SU); in nodeScheduled()
487 releaseSuccessors(SU, true); in nodeScheduled()
490 if (HasLowLatencyNonWaitedParent[NodeNum2Index[SU->NodeNum]]) in nodeScheduled()
493 if (DAG->IsLowLatencySU[SU->NodeNum]) { in nodeScheduled()
494 for (SDep& Succ : SU->Succs) { in nodeScheduled()
501 SU->isScheduled = true; in nodeScheduled()
506 for (SUnit* SU : SUnits) { in finalizeUnits()
507 releaseSuccessors(SU, false); in finalizeUnits()
508 if (DAG->IsHighLatencySU[SU->NodeNum]) in finalizeUnits()
580 for (SUnit* SU : SUnits) { in printDebug()
581 SU->dump(DAG); in printDebug()
584 for (SUnit* SU : SUnits) { in printDebug()
585 SU->dump(DAG); in printDebug()
623 bool SIScheduleBlockCreator::isSUInBlock(SUnit *SU, unsigned ID) { in isSUInBlock() argument
624 if (SU->NodeNum >= DAG->SUnits.size()) in isSUInBlock()
626 return CurrentBlocks[Node2CurrentBlock[SU->NodeNum]]->getID() == ID; in isSUInBlock()
633 SUnit *SU = &DAG->SUnits[i]; in colorHighLatenciesAlone() local
634 if (DAG->IsHighLatencySU[SU->NodeNum]) { in colorHighLatenciesAlone()
635 CurrentColoring[SU->NodeNum] = NextReservedID++; in colorHighLatenciesAlone()
649 SUnit *SU = &DAG->SUnits[i]; in colorHighLatenciesGroups() local
650 if (DAG->IsHighLatencySU[SU->NodeNum]) in colorHighLatenciesGroups()
665 SUnit *SU = &DAG->SUnits[i]; in colorHighLatenciesGroups() local
666 if (DAG->IsHighLatencySU[SU->NodeNum]) { in colorHighLatenciesGroups()
677 if (!DAG->canAddEdge(SU, &DAG->SUnits[j]) || in colorHighLatenciesGroups()
678 !DAG->canAddEdge(&DAG->SUnits[j], SU)) in colorHighLatenciesGroups()
686 FormingGroup.insert(SU->NodeNum); in colorHighLatenciesGroups()
690 FormingGroup.insert(SU->NodeNum); in colorHighLatenciesGroups()
692 CurrentColoring[SU->NodeNum] = ProposedColor; in colorHighLatenciesGroups()
711 SUnit *SU = &DAG->SUnits[SUNum]; in colorComputeReservedDependencies() local
715 if (CurrentColoring[SU->NodeNum]) { in colorComputeReservedDependencies()
716 CurrentTopDownReservedDependencyColoring[SU->NodeNum] = in colorComputeReservedDependencies()
717 CurrentColoring[SU->NodeNum]; in colorComputeReservedDependencies()
721 for (SDep& PredDep : SU->Preds) { in colorComputeReservedDependencies()
733 CurrentTopDownReservedDependencyColoring[SU->NodeNum] = in colorComputeReservedDependencies()
739 CurrentTopDownReservedDependencyColoring[SU->NodeNum] = Pos->second; in colorComputeReservedDependencies()
741 CurrentTopDownReservedDependencyColoring[SU->NodeNum] = in colorComputeReservedDependencies()
753 SUnit *SU = &DAG->SUnits[SUNum]; in colorComputeReservedDependencies() local
757 if (CurrentColoring[SU->NodeNum]) { in colorComputeReservedDependencies()
758 CurrentBottomUpReservedDependencyColoring[SU->NodeNum] = in colorComputeReservedDependencies()
759 CurrentColoring[SU->NodeNum]; in colorComputeReservedDependencies()
763 for (SDep& SuccDep : SU->Succs) { in colorComputeReservedDependencies()
775 CurrentBottomUpReservedDependencyColoring[SU->NodeNum] = in colorComputeReservedDependencies()
781 CurrentBottomUpReservedDependencyColoring[SU->NodeNum] = Pos->second; in colorComputeReservedDependencies()
783 CurrentBottomUpReservedDependencyColoring[SU->NodeNum] = in colorComputeReservedDependencies()
799 SUnit *SU = &DAG->SUnits[i]; in colorAccordingToReservedDependencies() local
803 if (CurrentColoring[SU->NodeNum]) in colorAccordingToReservedDependencies()
806 SUColors.first = CurrentTopDownReservedDependencyColoring[SU->NodeNum]; in colorAccordingToReservedDependencies()
807 SUColors.second = CurrentBottomUpReservedDependencyColoring[SU->NodeNum]; in colorAccordingToReservedDependencies()
812 CurrentColoring[SU->NodeNum] = Pos->second; in colorAccordingToReservedDependencies()
814 CurrentColoring[SU->NodeNum] = NextNonReservedID; in colorAccordingToReservedDependencies()
825 SUnit *SU = &DAG->SUnits[SUNum]; in colorEndsAccordingToDependencies() local
829 if (CurrentColoring[SU->NodeNum] <= (int)DAGSize) in colorEndsAccordingToDependencies()
832 if (CurrentBottomUpReservedDependencyColoring[SU->NodeNum] > 0 || in colorEndsAccordingToDependencies()
833 CurrentTopDownReservedDependencyColoring[SU->NodeNum] > 0) in colorEndsAccordingToDependencies()
836 for (SDep& SuccDep : SU->Succs) { in colorEndsAccordingToDependencies()
846 PendingColoring[SU->NodeNum] = *SUColors.begin(); in colorEndsAccordingToDependencies()
849 PendingColoring[SU->NodeNum] = NextNonReservedID++; in colorEndsAccordingToDependencies()
866 SUnit *SU = &DAG->SUnits[i]; in colorForceConsecutiveOrderInGroup() local
869 assert(i == SU->NodeNum); in colorForceConsecutiveOrderInGroup()
875 if (CurrentColoring[SU->NodeNum] <= (int)DAGSize) in colorForceConsecutiveOrderInGroup()
892 SUnit *SU = &DAG->SUnits[SUNum]; in colorMergeConstantLoadsNextGroup() local
895 if (CurrentColoring[SU->NodeNum] <= (int)DAGSize) in colorMergeConstantLoadsNextGroup()
900 if (SU->Preds.size() > 0 && !DAG->IsLowLatencySU[SU->NodeNum]) in colorMergeConstantLoadsNextGroup()
903 for (SDep& SuccDep : SU->Succs) { in colorMergeConstantLoadsNextGroup()
910 CurrentColoring[SU->NodeNum] = *SUColors.begin(); in colorMergeConstantLoadsNextGroup()
918 SUnit *SU = &DAG->SUnits[SUNum]; in colorMergeIfPossibleNextGroup() local
921 if (CurrentColoring[SU->NodeNum] <= (int)DAGSize) in colorMergeIfPossibleNextGroup()
924 for (SDep& SuccDep : SU->Succs) { in colorMergeIfPossibleNextGroup()
931 CurrentColoring[SU->NodeNum] = *SUColors.begin(); in colorMergeIfPossibleNextGroup()
939 SUnit *SU = &DAG->SUnits[SUNum]; in colorMergeIfPossibleNextGroupOnlyForReserved() local
942 if (CurrentColoring[SU->NodeNum] <= (int)DAGSize) in colorMergeIfPossibleNextGroupOnlyForReserved()
945 for (SDep& SuccDep : SU->Succs) { in colorMergeIfPossibleNextGroupOnlyForReserved()
952 CurrentColoring[SU->NodeNum] = *SUColors.begin(); in colorMergeIfPossibleNextGroupOnlyForReserved()
961 SUnit *SU = &DAG->SUnits[SUNum]; in colorMergeIfPossibleSmallGroupsToNextGroup() local
962 unsigned color = CurrentColoring[SU->NodeNum]; in colorMergeIfPossibleSmallGroupsToNextGroup()
972 SUnit *SU = &DAG->SUnits[SUNum]; in colorMergeIfPossibleSmallGroupsToNextGroup() local
973 unsigned color = CurrentColoring[SU->NodeNum]; in colorMergeIfPossibleSmallGroupsToNextGroup()
976 if (CurrentColoring[SU->NodeNum] <= (int)DAGSize) in colorMergeIfPossibleSmallGroupsToNextGroup()
982 for (SDep& SuccDep : SU->Succs) { in colorMergeIfPossibleSmallGroupsToNextGroup()
990 CurrentColoring[SU->NodeNum] = *SUColors.begin(); in colorMergeIfPossibleSmallGroupsToNextGroup()
1005 SUnit *SU = &DAG->SUnits[SUNum]; in regroupNoUserInstructions() local
1008 if (CurrentColoring[SU->NodeNum] <= (int)DAGSize) in regroupNoUserInstructions()
1011 for (SDep& SuccDep : SU->Succs) { in regroupNoUserInstructions()
1018 CurrentColoring[SU->NodeNum] = GroupID; in regroupNoUserInstructions()
1055 SUnit *SU = &DAG->SUnits[i]; in createBlocksForVariant() local
1056 unsigned Color = CurrentColoring[SU->NodeNum]; in createBlocksForVariant()
1064 CurrentBlocks[RealID[Color]]->addUnit(SU); in createBlocksForVariant()
1065 Node2CurrentBlock[SU->NodeNum] = RealID[Color]; in createBlocksForVariant()
1070 SUnit *SU = &DAG->SUnits[i]; in createBlocksForVariant() local
1072 for (SDep& SuccDep : SU->Succs) { in createBlocksForVariant()
1079 for (SDep& PredDep : SU->Preds) { in createBlocksForVariant()
1204 for (SUnit* SU : SUs) { in scheduleInsideBlocks()
1205 MachineInstr *MI = SU->getInstr(); in scheduleInsideBlocks()
1642 for (SUnit* SU : SUs) in scheduleVariant()
1643 Res.SUs.push_back(SU->NodeNum); in scheduleVariant()
1691 SUnit *SU = &SUnits[ScheduledSUnits[i]]; in moveLowLatencies() local
1695 for (SDep& PredDep : SU->Preds) { in moveLowLatencies()
1707 if (SITII->isLowLatencyInstruction(*SU->getInstr())) { in moveLowLatencies()
1718 ScheduledSUnits[BestPos] = SU->NodeNum; in moveLowLatencies()
1719 ScheduledSUnitsInv[SU->NodeNum] = BestPos; in moveLowLatencies()
1728 } else if (SU->getInstr()->getOpcode() == AMDGPU::COPY) { in moveLowLatencies()
1730 for (SDep& SuccDep : SU->Succs) { in moveLowLatencies()
1743 ScheduledSUnits[MinPos] = SU->NodeNum; in moveLowLatencies()
1744 ScheduledSUnitsInv[SU->NodeNum] = MinPos; in moveLowLatencies()
1789 for(SUnit& SU : SUnits) in schedule()
1790 SU.dumpAll(this) in schedule()
1814 SUnit *SU = &SUnits[i]; in schedule() local
1817 if (SITII->isLowLatencyInstruction(*SU->getInstr())) { in schedule()
1819 if (SITII->getMemOpBaseRegImmOfs(*SU->getInstr(), BaseLatReg, OffLatReg, in schedule()
1822 } else if (SITII->isHighLatencyInstruction(*SU->getInstr())) in schedule()
1885 SUnit *SU = &SUnits[*I]; in schedule() local
1887 scheduleMI(SU, true); in schedule()
1889 DEBUG(dbgs() << "Scheduling SU(" << SU->NodeNum << ") " in schedule()
1890 << *SU->getInstr()); in schedule()