Lines Matching defs:SU
222 SUnit *SU = WorkList.pop_back_val();
223 SU->isDepthCurrent = false;
224 for (SDep &SuccDep : SU->Succs) {
237 SUnit *SU = WorkList.pop_back_val();
238 SU->isHeightCurrent = false;
239 for (SDep &PredDep : SU->Preds) {
356 LLVM_DUMP_METHOD void ScheduleDAG::dumpNodeName(const SUnit &SU) const {
357 if (&SU == &EntrySU)
359 else if (&SU == &ExitSU)
362 dbgs() << "SU(" << SU.NodeNum << ")";
365 LLVM_DUMP_METHOD void ScheduleDAG::dumpNodeAll(const SUnit &SU) const {
366 dumpNode(SU);
367 SU.dumpAttributes();
368 if (SU.Preds.size() > 0) {
370 for (const SDep &Dep : SU.Preds) {
378 if (SU.Succs.size() > 0) {
380 for (const SDep &Dep : SU.Succs) {
482 for (SUnit &SU : SUnits) {
483 int NodeNum = SU.NodeNum;
484 unsigned Degree = SU.Succs.size();
490 assert(SU.Succs.empty() && "SUnit should have no successors");
492 WorkList.push_back(&SU);
498 SUnit *SU = WorkList.back();
500 if (SU->NodeNum < DAGSize)
501 Allocate(SU->NodeNum, --Id);
502 for (const SDep &PredDep : SU->Preds) {
503 SUnit *SU = PredDep.getSUnit();
504 if (SU->NodeNum < DAGSize && !--Node2Index[SU->NodeNum])
507 WorkList.push_back(SU);
516 for (SUnit &SU : SUnits) {
517 for (const SDep &PD : SU.Preds) {
518 assert(Node2Index[SU.NodeNum] > Node2Index[PD.getSUnit()->NodeNum] &&
572 void ScheduleDAGTopologicalSort::DFS(const SUnit *SU, int UpperBound,
577 WorkList.push_back(SU);
579 SU = WorkList.back();
581 Visited.set(SU->NodeNum);
582 for (const SDep &SuccDep : llvm::reverse(SU->Succs)) {
621 const SUnit *SU = WorkList.back();
623 for (const SDep &SD : llvm::reverse(SU->Succs)) {
655 const SUnit *SU = WorkList.back();
657 for (const SDep &SD : llvm::reverse(SU->Preds)) {
705 bool ScheduleDAGTopologicalSort::WillCreateCycle(SUnit *TargetSU, SUnit *SU) {
707 // Is SU reachable from TargetSU via successor edges?
708 if (IsReachable(SU, TargetSU))
712 IsReachable(SU, PredDep.getSUnit()))
717 void ScheduleDAGTopologicalSort::AddSUnitWithoutPredecessors(const SUnit *SU) {
718 assert(SU->NodeNum == Index2Node.size() && "Node cannot be added at the end");
719 assert(SU->NumPreds == 0 && "Can only add SU's with no predecessors");
721 Index2Node.push_back(SU->NodeNum);
725 bool ScheduleDAGTopologicalSort::IsReachable(const SUnit *SU,
728 assert(SU != nullptr && "Invalid SUnit");
730 // If insertion of the edge SU->TargetSU would create a cycle
731 // then there is a path from TargetSU to SU.
734 UpperBound = Node2Index[SU->NodeNum];
736 // Is Ord(TargetSU) < Ord(SU) ?
739 // There may be a path from TargetSU to SU. Check for it.