• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /freebsd-13-stable/contrib/llvm-project/llvm/lib/CodeGen/SelectionDAG/

Lines Matching defs:SU

71 ResourcePriorityQueue::numberRCValPredInSU(SUnit *SU, unsigned RCId) {
73 for (SDep &Pred : SU->Preds) {
108 unsigned ResourcePriorityQueue::numberRCValSuccInSU(SUnit *SU,
111 for (const SDep &Succ : SU->Succs) {
146 static unsigned numberCtrlDepsInSU(SUnit *SU) {
148 for (const SDep &Succ : SU->Succs)
155 static unsigned numberCtrlPredInSU(SUnit *SU) {
157 for (SDep &Pred : SU->Preds)
172 SUnit *SU = &(*SUnits)[i];
173 initNumRegDefsLeft(SU);
174 SU->NodeQueueId = 0;
213 /// of SU, return it, otherwise return null.
214 SUnit *ResourcePriorityQueue::getSingleUnscheduledPred(SUnit *SU) {
216 for (const SDep &Pred : SU->Preds) {
229 void ResourcePriorityQueue::push(SUnit *SU) {
233 for (const SDep &Succ : SU->Succs)
234 if (getSingleUnscheduledPred(Succ.getSUnit()) == SU)
237 NumNodesSolelyBlocking[SU->NodeNum] = NumNodesBlocking;
238 Queue.push_back(SU);
241 /// Check if scheduling of this SU is possible
243 bool ResourcePriorityQueue::isResourceAvailable(SUnit *SU) {
244 if (!SU || !SU->getNode())
249 if (SU->getNode()->getGluedNode())
254 if (SU->getNode()->isMachineOpcode())
255 switch (SU->getNode()->getMachineOpcode()) {
258 SU->getNode()->getMachineOpcode())))
278 if (Succ.getSUnit() == SU)
286 void ResourcePriorityQueue::reserveResources(SUnit *SU) {
287 // If this SU does not fit in the packet
289 if (!isResourceAvailable(SU) || SU->getNode()->getGluedNode()) {
294 if (SU->getNode() && SU->getNode()->isMachineOpcode()) {
295 switch (SU->getNode()->getMachineOpcode()) {
298 SU->getNode()->getMachineOpcode()));
307 Packet.push_back(SU);
323 int ResourcePriorityQueue::rawRegPressureDelta(SUnit *SU, unsigned RCId) {
326 if (!SU || !SU->getNode() || !SU->getNode()->isMachineOpcode())
330 for (unsigned i = 0, e = SU->getNode()->getNumValues(); i != e; ++i) {
331 MVT VT = SU->getNode()->getSimpleValueType(i);
335 RegBalance += numberRCValSuccInSU(SU, RCId);
338 for (unsigned i = 0, e = SU->getNode()->getNumOperands(); i != e; ++i) {
339 const SDValue &Op = SU->getNode()->getOperand(i);
346 RegBalance -= numberRCValPredInSU(SU, RCId);
351 /// Estimates change in reg pressure from this SU.
357 int ResourcePriorityQueue::regPressureDelta(SUnit *SU, bool RawPressure) {
360 if (!SU || !SU->getNode() || !SU->getNode()->isMachineOpcode())
365 RegBalance += rawRegPressureDelta(SU, RC->getID());
370 rawRegPressureDelta(SU, RC->getID()) > 0) &&
372 rawRegPressureDelta(SU, RC->getID()) >= RegLimit[RC->getID()]))
373 RegBalance += rawRegPressureDelta(SU, RC->getID());
391 /// Returns single number reflecting benefit of scheduling SU
393 int ResourcePriorityQueue::SUSchedulingCost(SUnit *SU) {
398 if (SU->isScheduled)
402 if (SU->isScheduleHigh)
410 ResCount += (SU->getHeight() * ScaleTwo);
413 if (isResourceAvailable(SU))
417 // this SU.
418 ResCount -= (regPressureDelta(SU,true) * ScaleOne);
424 ResCount += (SU->getHeight() * ScaleTwo);
425 // Now see how many instructions is blocked by this SU.
426 ResCount += (NumNodesSolelyBlocking[SU->NodeNum] * ScaleTwo);
429 if (isResourceAvailable(SU))
432 ResCount -= (regPressureDelta(SU) * ScaleTwo);
438 for (SDNode *N = SU->getNode(); N; N = N->getGluedNode()) {
464 void ResourcePriorityQueue::scheduledNode(SUnit *SU) {
467 if (!SU) {
473 const SDNode *ScegN = SU->getNode();
484 RegPressure[RC->getID()] += numberRCValSuccInSU(SU, RC->getID());
496 (numberRCValPredInSU(SU, RC->getID())))
497 RegPressure[RC->getID()] -= numberRCValPredInSU(SU, RC->getID());
502 for (SDep &Pred : SU->Preds) {
509 // Reserve resources for this SU.
510 reserveResources(SU);
517 for (const SDep &Succ : SU->Succs) {
524 if (ParallelLiveRanges >= SU->NumPreds)
525 ParallelLiveRanges -= SU->NumPreds;
531 ParallelLiveRanges += SU->NumRegDefsLeft;
534 HorizontalVerticalBalance += (SU->Succs.size() - numberCtrlDepsInSU(SU));
535 HorizontalVerticalBalance -= (SU->Preds.size() - numberCtrlPredInSU(SU));
538 void ResourcePriorityQueue::initNumRegDefsLeft(SUnit *SU) {
540 for (SDNode *N = SU->getNode(); N; N = N->getGluedNode())
562 SU->NumRegDefsLeft = NodeNumDefs;
565 /// adjustPriorityOfUnscheduledPreds - One of the predecessors of SU was just
566 /// scheduled. If SU is not itself available, then there is at least one
567 /// predecessor node that has not been scheduled yet. If SU has exactly ONE
571 void ResourcePriorityQueue::adjustPriorityOfUnscheduledPreds(SUnit *SU) {
572 if (SU->isAvailable) return; // All preds scheduled.
574 SUnit *OnlyAvailablePred = getSingleUnscheduledPred(SU);
622 void ResourcePriorityQueue::remove(SUnit *SU) {
624 std::vector<SUnit *>::iterator I = find(Queue, SU);