Lines Matching defs:SUnit

28   class SUnit;
74 /// Dep - A pointer to the depending/depended-on SUnit, and an enum
76 PointerIntPair<SUnit *, 2, Kind> Dep;
101 SDep(SUnit *S, Kind kind, unsigned Reg)
119 SDep(SUnit *S, OrderKind kind)
159 //// getSUnit - Return the SUnit to which this edge points.
160 SUnit *getSUnit() const {
164 //// setSUnit - Assign the SUnit to which this edge points.
165 void setSUnit(SUnit *SU) {
260 /// SUnit - Scheduling unit. This is a node in the scheduling DAG.
261 class SUnit {
268 SUnit *OrigNode; // If not this, the node from which
323 /// SUnit - Construct an SUnit for pre-regalloc scheduling to represent
325 SUnit(SDNode *node, unsigned nodenum)
339 /// SUnit - Construct an SUnit for post-regalloc scheduling to represent
341 SUnit(MachineInstr *instr, unsigned nodenum)
355 /// SUnit - Construct a placeholder SUnit.
356 SUnit()
379 /// setNode - Assign the representative SDNode for this SUnit.
382 assert(!Instr && "Setting SDNode of SUnit with MachineInstr!");
386 /// getNode - Return the representative SDNode for this SUnit.
389 assert(!Instr && "Reading SDNode of SUnit with MachineInstr!");
393 /// isInstr - Return true if this SUnit refers to a machine instruction as
397 /// setInstr - Assign the instruction for the SUnit.
400 assert(!Node && "Setting MachineInstr of SUnit with SDNode!");
404 /// getInstr - Return the representative MachineInstr for this SUnit.
407 assert(!Node && "Reading MachineInstr of SUnit with SDNode!");
425 const_cast<SUnit *>(this)->ComputeDepth();
433 const_cast<SUnit *>(this)->ComputeHeight();
458 bool isPred(SUnit *N) {
466 bool isSucc(SUnit *N) {
512 virtual void initNodes(std::vector<SUnit> &SUnits) = 0;
513 virtual void addNode(const SUnit *SU) = 0;
514 virtual void updateNode(const SUnit *SU) = 0;
523 virtual bool isReady(SUnit *) const {
527 virtual void push(SUnit *U) = 0;
529 void push_all(const std::vector<SUnit *> &Nodes) {
530 for (std::vector<SUnit *>::const_iterator I = Nodes.begin(),
535 virtual SUnit *pop() = 0;
537 virtual void remove(SUnit *SU) = 0;
545 virtual void scheduledNode(SUnit *) {}
547 virtual void unscheduledNode(SUnit *) {}
565 std::vector<SUnit> SUnits; // The scheduling units.
566 SUnit EntrySU; // Special node for the region entry.
567 SUnit ExitSU; // Special node for the region exit.
582 /// getInstrDesc - Return the MCInstrDesc of this SUnit.
584 const MCInstrDesc *getInstrDesc(const SUnit *SU) const {
595 virtual void dumpNode(const SUnit *SU) const = 0;
597 /// getGraphNodeLabel - Return a label for an SUnit node in a visualization
599 virtual std::string getGraphNodeLabel(const SUnit *SU) const = 0;
620 SUnit, ptrdiff_t> {
621 SUnit *Node;
624 SUnitIterator(SUnit *N, unsigned Op) : Node(N), Operand(Op) {}
644 static SUnitIterator begin(SUnit *N) { return SUnitIterator(N, 0); }
645 static SUnitIterator end (SUnit *N) {
650 const SUnit *getNode() const { return Node; }
663 template <> struct GraphTraits<SUnit*> {
664 typedef SUnit NodeType;
666 static inline NodeType *getEntryNode(SUnit *N) { return N; }
675 template <> struct GraphTraits<ScheduleDAG*> : public GraphTraits<SUnit*> {
676 typedef std::vector<SUnit>::iterator nodes_iterator;
693 std::vector<SUnit> &SUnits;
694 SUnit *ExitSU;
706 void DFS(const SUnit *SU, int UpperBound, bool& HasLoop);
716 ScheduleDAGTopologicalSort(std::vector<SUnit> &SUnits, SUnit *ExitSU);
723 bool IsReachable(const SUnit *SU, const SUnit *TargetSU);
726 bool WillCreateCycle(SUnit *TargetSU, SUnit *SU);
729 /// to be added from SUnit X to SUnit Y.
730 void AddPred(SUnit *Y, SUnit *X);
735 void RemovePred(SUnit *M, SUnit *N);