Lines Matching refs:SUnit
220 SetVector<SUnit *> NodeOrder;
228 DenseMap<SUnit *, std::pair<unsigned, int64_t>> InstrChanges;
236 std::vector<SUnit> &SUnits;
237 SetVector<SUnit *> Stack;
239 SmallVector<SmallPtrSet<SUnit *, 4>, 10> B;
245 Circuits(std::vector<SUnit> &SUs) in Circuits()
252 B.assign(SUnits.size(), SmallPtrSet<SUnit *, 4>()); in reset()
274 int getASAP(SUnit *Node) { return ScheduleInfo[Node->NodeNum].ASAP; } in getASAP()
277 int getALAP(SUnit *Node) { return ScheduleInfo[Node->NodeNum].ALAP; } in getALAP()
281 int getMOV(SUnit *Node) { return getALAP(Node) - getASAP(Node); } in getMOV()
284 int getDepth(SUnit *Node) { return Node->getDepth(); } in getDepth()
287 int getHeight(SUnit *Node) { return Node->getHeight(); } in getHeight()
292 bool isBackedge(SUnit *Source, const SDep &Dep) { in isBackedge()
299 static bool isOrder(SUnit *Source, const SDep &Dep) { in isOrder()
306 bool isLoopCarriedOrder(SUnit *Source, const SDep &Dep, bool isSucc = true);
309 unsigned getLatency(SUnit *Source, const SDep &Dep) { in getLatency()
324 unsigned getDistance(SUnit *U, SUnit *V, const SDep &Dep) { in getDistance()
340 unsigned getInstrBaseReg(SUnit *SU) { in getInstrBaseReg()
341 DenseMap<SUnit *, std::pair<unsigned, int64_t>>::iterator It = in getInstrBaseReg()
362 void addConnectedNodes(SUnit *SU, NodeSet &NewSet,
363 SetVector<SUnit *> &NodesAdded);
421 SetVector<SUnit *> Nodes;
427 SUnit *ExceedPressure = nullptr;
430 typedef SetVector<SUnit *>::const_iterator iterator;
436 bool insert(SUnit *SU) { return Nodes.insert(SU); } in insert()
444 unsigned count(SUnit *SU) const { return Nodes.count(SU); } in count()
452 SUnit *getNode(unsigned i) const { return Nodes[i]; }; in getNode()
458 void setExceedPressure(SUnit *SU) { ExceedPressure = SU; } in setExceedPressure()
460 bool isExceedSU(SUnit *SU) { return ExceedPressure == SU; } in isExceedSU()
468 for (SUnit *SU : *this) { in computeNodeSetInfo()
484 operator SetVector<SUnit *> &() { return Nodes; } in operator SetVector<SUnit*>&()
533 DenseMap<int, std::deque<SUnit *>> ScheduledInstrs;
536 std::map<SUnit *, int> InstrToCycle;
605 void computeStart(SUnit *SU, int *MaxEarlyStart, int *MinLateStart,
607 bool insert(SUnit *SU, int StartCycle, int EndCycle, int II);
610 typedef DenseMap<int, std::deque<SUnit *>>::iterator sched_iterator;
611 typedef DenseMap<int, std::deque<SUnit *>>::const_iterator
615 bool isScheduledAtStage(SUnit *SU, unsigned StageNum) { in isScheduledAtStage()
621 int stageScheduled(SUnit *SU) const { in stageScheduled()
622 std::map<SUnit *, int>::const_iterator it = InstrToCycle.find(SU); in stageScheduled()
630 unsigned cycleScheduled(SUnit *SU) const { in cycleScheduled()
631 std::map<SUnit *, int>::const_iterator it = InstrToCycle.find(SU); in cycleScheduled()
664 std::deque<SUnit *> &getInstructions(int cycle) { in getInstructions()
670 bool orderDependence(SwingSchedulerDAG *SSD, SUnit *SU,
671 std::deque<SUnit *> &Insts);
949 static bool isSuccOrder(SUnit *SUa, SUnit *SUb) { in isSuccOrder()
950 SmallPtrSet<SUnit *, 8> Visited; in isSuccOrder()
951 SmallVector<SUnit *, 8> Worklist; in isSuccOrder()
954 const SUnit *SU = Worklist.pop_back_val(); in isSuccOrder()
956 SUnit *SuccSU = SI.getSUnit(); in isSuccOrder()
997 MapVector<Value *, SmallVector<SUnit *, 4>> PendingLoads; in addLoopCarriedDependences()
1006 SmallVector<SUnit *, 4> &SUs = PendingLoads[V]; in addLoopCarriedDependences()
1013 MapVector<Value *, SmallVector<SUnit *, 4>>::iterator I = in addLoopCarriedDependences()
1080 for (SUnit &I : SUnits) { in updatePhiDependences()
1100 SUnit *SU = getSUnit(UseMI); in updatePhiDependences()
1119 SUnit *SU = getSUnit(DefMI); in updatePhiDependences()
1162 for (SUnit &I : SUnits) { in changeDependences()
1174 SUnit *DefSU = getSUnit(DefMI); in changeDependences()
1181 SUnit *LastSU = getSUnit(LastMI); in changeDependences()
1190 for (SUnit::pred_iterator P = I.Preds.begin(), E = I.Preds.end(); P != E; in changeDependences()
1371 static void swapAntiDependences(std::vector<SUnit> &SUnits) { in swapAntiDependences()
1372 SmallVector<std::pair<SUnit *, SDep>, 8> DepsAdded; in swapAntiDependences()
1374 SUnit *SU = &SUnits[i]; in swapAntiDependences()
1375 for (SUnit::pred_iterator IP = SU->Preds.begin(), EP = SU->Preds.end(); in swapAntiDependences()
1382 for (SmallVector<std::pair<SUnit *, SDep>, 8>::iterator I = DepsAdded.begin(), in swapAntiDependences()
1386 SUnit *SU = I->first; in swapAntiDependences()
1388 SUnit *TargetSU = D.getSUnit(); in swapAntiDependences()
1438 SUnit *SV = &SUnits[V]; in circuit()
1477 SmallPtrSet<SUnit *, 4> &BU = B[U]; in unblock()
1479 SmallPtrSet<SUnit *, 4>::iterator SI = BU.begin(); in unblock()
1481 SUnit *W = *SI; in unblock()
1530 SUnit *SU = &SUnits[*I]; in computeNodeFunctions()
1541 SUnit *SU = &SUnits[*I]; in computeNodeFunctions()
1542 for (SUnit::const_pred_iterator IP = SU->Preds.begin(), in computeNodeFunctions()
1547 SUnit *pred = IP->getSUnit(); in computeNodeFunctions()
1560 SUnit *SU = &SUnits[*I]; in computeNodeFunctions()
1561 for (SUnit::const_succ_iterator IS = SU->Succs.begin(), in computeNodeFunctions()
1566 SUnit *succ = IS->getSUnit(); in computeNodeFunctions()
1593 static bool pred_L(SetVector<SUnit *> &NodeOrder, in pred_L()
1594 SmallSetVector<SUnit *, 8> &Preds, in pred_L() argument
1597 for (SetVector<SUnit *>::iterator I = NodeOrder.begin(), E = NodeOrder.end(); in pred_L()
1599 for (SUnit::pred_iterator PI = (*I)->Preds.begin(), PE = (*I)->Preds.end(); in pred_L()
1609 for (SUnit::const_succ_iterator IS = (*I)->Succs.begin(), in pred_L()
1626 static bool succ_L(SetVector<SUnit *> &NodeOrder, in succ_L()
1627 SmallSetVector<SUnit *, 8> &Succs, in succ_L() argument
1630 for (SetVector<SUnit *>::iterator I = NodeOrder.begin(), E = NodeOrder.end(); in succ_L()
1632 for (SUnit::succ_iterator SI = (*I)->Succs.begin(), SE = (*I)->Succs.end(); in succ_L()
1641 for (SUnit::const_pred_iterator PI = (*I)->Preds.begin(), in succ_L()
1657 static bool computePath(SUnit *Cur, SetVector<SUnit *> &Path, in computePath()
1658 SetVector<SUnit *> &DestNodes, in computePath()
1659 SetVector<SUnit *> &Exclude, in computePath()
1660 SmallPtrSet<SUnit *, 8> &Visited) { in computePath() argument
1698 for (SUnit *SU : NS) { in computeLiveOuts()
1712 for (SUnit *SU : NS) in computeLiveOuts()
1741 std::vector<SUnit *> SUnits(NS.begin(), NS.end()); in registerPressureFilter()
1742 std::sort(SUnits.begin(), SUnits.end(), [](const SUnit *A, const SUnit *B) { in registerPressureFilter()
1777 SmallSetVector<SUnit *, 8> S1; in colocateNodeSets()
1784 SmallSetVector<SUnit *, 8> S2; in colocateNodeSets()
1822 SetVector<SUnit *> NodesAdded; in groupRemainingNodes()
1823 SmallPtrSet<SUnit *, 8> Visited; in groupRemainingNodes()
1827 SmallSetVector<SUnit *, 8> N; in groupRemainingNodes()
1830 SetVector<SUnit *> Path; in groupRemainingNodes()
1831 for (SUnit *NI : N) { in groupRemainingNodes()
1841 SetVector<SUnit *> Path; in groupRemainingNodes()
1842 for (SUnit *NI : N) { in groupRemainingNodes()
1855 SmallSetVector<SUnit *, 8> N; in groupRemainingNodes()
1857 for (SUnit *I : N) in groupRemainingNodes()
1866 for (SUnit *I : N) in groupRemainingNodes()
1874 SUnit *SU = &SUnits[i]; in groupRemainingNodes()
1885 void SwingSchedulerDAG::addConnectedNodes(SUnit *SU, NodeSet &NewSet, in addConnectedNodes()
1886 SetVector<SUnit *> &NodesAdded) { in addConnectedNodes()
1890 SUnit *Successor = SI.getSUnit(); in addConnectedNodes()
1895 SUnit *Predecessor = PI.getSUnit(); in addConnectedNodes()
1903 static bool isIntersect(SmallSetVector<SUnit *, 8> &Set1, const NodeSet &Set2, in isIntersect() argument
1904 SmallSetVector<SUnit *, 8> &Result) { in isIntersect()
1907 SUnit *SU = Set1[i]; in isIntersect()
1941 J->remove_if([&](SUnit *SUJ) { return I->count(SUJ); }); in removeDuplicateNodes()
1953 static bool hasDataDependence(SUnit *Inst1, SUnit *Inst2) { in hasDataDependence()
1965 SmallSetVector<SUnit *, 8> R; in computeNodeOrder()
1971 SmallSetVector<SUnit *, 8> N; in computeNodeOrder()
1993 SUnit *maxASAP = nullptr; in computeNodeOrder()
1994 for (SUnit *SU : Nodes) { in computeNodeOrder()
2009 SUnit *maxHeight = nullptr; in computeNodeOrder()
2010 for (SUnit *I : R) { in computeNodeOrder()
2045 SmallSetVector<SUnit *, 8> N; in computeNodeOrder()
2053 SUnit *maxDepth = nullptr; in computeNodeOrder()
2054 for (SUnit *I : R) { in computeNodeOrder()
2095 SmallSetVector<SUnit *, 8> N; in computeNodeOrder()
2105 for (SUnit *I : NodeOrder) in computeNodeOrder()
2125 SetVector<SUnit *>::iterator NI = NodeOrder.begin(); in schedulePipeline()
2126 SetVector<SUnit *>::iterator NE = NodeOrder.end(); in schedulePipeline()
2128 SUnit *SU = *NI; in schedulePipeline()
2230 std::deque<SUnit *> &CycleInstrs = Schedule.getInstructions(Cycle); in generatePipelinedLoop()
2232 for (SUnit *CI : CycleInstrs) { in generatePipelinedLoop()
3106 DenseMap<SUnit *, std::pair<unsigned, int64_t>>::iterator It = in cloneAndChangeInstr()
3270 SUnit *OrigMISU = getSUnit(OrigInstr->second); in rewriteScheduledInstr()
3362 SUnit *SU = getSUnit(MI); in applyInstrChange()
3363 DenseMap<SUnit *, std::pair<unsigned, int64_t>>::iterator It = in applyInstrChange()
3401 bool SwingSchedulerDAG::isLoopCarriedOrder(SUnit *Source, const SDep &Dep, in isLoopCarriedOrder()
3456 bool SMSchedule::insert(SUnit *SU, int StartCycle, int EndCycle, int II) { in insert()
3470 std::deque<SUnit *> &cycleInstrs = ScheduledInstrs[checkCycle]; in insert()
3472 for (std::deque<SUnit *>::iterator I = cycleInstrs.begin(), in insert()
3507 SmallPtrSet<SUnit *, 8> Visited; in earliestCycleInChain()
3513 SUnit *PrevSU = Cur.getSUnit(); in earliestCycleInChain()
3516 std::map<SUnit *, int>::const_iterator it = InstrToCycle.find(PrevSU); in earliestCycleInChain()
3530 SmallPtrSet<SUnit *, 8> Visited; in latestCycleInChain()
3536 SUnit *SuccSU = Cur.getSUnit(); in latestCycleInChain()
3539 std::map<SUnit *, int>::const_iterator it = InstrToCycle.find(SuccSU); in latestCycleInChain()
3554 static SUnit *multipleIterations(SUnit *SU, SwingSchedulerDAG *DAG) { in multipleIterations()
3565 void SMSchedule::computeStart(SUnit *SU, int *MaxEarlyStart, int *MinLateStart, in computeStart()
3574 for (SUnit *I : getInstructions(cycle)) { in computeStart()
3596 SUnit *BE = multipleIterations(I, DAG); in computeStart()
3625 bool SMSchedule::orderDependence(SwingSchedulerDAG *SSD, SUnit *SU, in orderDependence()
3626 std::deque<SUnit *> &Insts) { in orderDependence()
3636 for (std::deque<SUnit *>::iterator I = Insts.begin(), E = Insts.end(); I != E; in orderDependence()
3736 SUnit *UseSU = Insts.at(MoveUse); in orderDependence()
3737 SUnit *DefSU = Insts.at(MoveDef); in orderDependence()
3770 SUnit *DefSU = SSD->getSUnit(&Phi); in isLoopCarried()
3777 SUnit *UseSU = SSD->getSUnit(MRI.getVRegDef(LoopVal)); in isLoopCarried()
3824 SUnit &SU = SSD->SUnits[i]; in isValidSchedule()
3846 std::deque<SUnit *> &cycleInstrs = in finalizeSchedule()
3848 for (std::deque<SUnit *>::reverse_iterator I = cycleInstrs.rbegin(), in finalizeSchedule()
3872 SUnit *SUnitUse = SSD->getSUnit(UseMI); in finalizeSchedule()
3897 SUnit *SU = &SSD->SUnits[i]; in finalizeSchedule()
3904 std::deque<SUnit *> &cycleInstrs = ScheduledInstrs[Cycle]; in finalizeSchedule()
3905 std::deque<SUnit *> newOrderZC; in finalizeSchedule()
3908 SUnit *SU = cycleInstrs[i]; in finalizeSchedule()
3912 std::deque<SUnit *> newOrderI; in finalizeSchedule()
3915 SUnit *SU = cycleInstrs[i]; in finalizeSchedule()
3933 for (SUnit *CI : cycleInstrs->second) { in print()