• Home
  • Raw
  • Download

Lines Matching refs:SU

70 ResourcePriorityQueue::numberRCValPredInSU(SUnit *SU, unsigned RCId) {  in numberRCValPredInSU()  argument
72 for (SUnit::pred_iterator I = SU->Preds.begin(), E = SU->Preds.end(); in numberRCValPredInSU()
107 unsigned ResourcePriorityQueue::numberRCValSuccInSU(SUnit *SU, in numberRCValSuccInSU() argument
110 for (SUnit::const_succ_iterator I = SU->Succs.begin(), E = SU->Succs.end(); in numberRCValSuccInSU()
145 static unsigned numberCtrlDepsInSU(SUnit *SU) { in numberCtrlDepsInSU() argument
147 for (SUnit::const_succ_iterator I = SU->Succs.begin(), E = SU->Succs.end(); in numberCtrlDepsInSU()
155 static unsigned numberCtrlPredInSU(SUnit *SU) { in numberCtrlPredInSU() argument
157 for (SUnit::pred_iterator I = SU->Preds.begin(), E = SU->Preds.end(); in numberCtrlPredInSU()
173 SUnit *SU = &(*SUnits)[i]; in initNodes() local
174 initNumRegDefsLeft(SU); in initNodes()
175 SU->NodeQueueId = 0; in initNodes()
215 SUnit *ResourcePriorityQueue::getSingleUnscheduledPred(SUnit *SU) { in getSingleUnscheduledPred() argument
217 for (SUnit::const_pred_iterator I = SU->Preds.begin(), E = SU->Preds.end(); in getSingleUnscheduledPred()
231 void ResourcePriorityQueue::push(SUnit *SU) { in push() argument
235 for (SUnit::const_succ_iterator I = SU->Succs.begin(), E = SU->Succs.end(); in push()
237 if (getSingleUnscheduledPred(I->getSUnit()) == SU) in push()
240 NumNodesSolelyBlocking[SU->NodeNum] = NumNodesBlocking; in push()
241 Queue.push_back(SU); in push()
246 bool ResourcePriorityQueue::isResourceAvailable(SUnit *SU) { in isResourceAvailable() argument
247 if (!SU || !SU->getNode()) in isResourceAvailable()
252 if (SU->getNode()->getGluedNode()) in isResourceAvailable()
257 if (SU->getNode()->isMachineOpcode()) in isResourceAvailable()
258 switch (SU->getNode()->getMachineOpcode()) { in isResourceAvailable()
261 SU->getNode()->getMachineOpcode()))) in isResourceAvailable()
281 if (I->getSUnit() == SU) in isResourceAvailable()
289 void ResourcePriorityQueue::reserveResources(SUnit *SU) { in reserveResources() argument
292 if (!isResourceAvailable(SU) || SU->getNode()->getGluedNode()) { in reserveResources()
297 if (SU->getNode() && SU->getNode()->isMachineOpcode()) { in reserveResources()
298 switch (SU->getNode()->getMachineOpcode()) { in reserveResources()
301 SU->getNode()->getMachineOpcode())); in reserveResources()
310 Packet.push_back(SU); in reserveResources()
326 int ResourcePriorityQueue::rawRegPressureDelta(SUnit *SU, unsigned RCId) { in rawRegPressureDelta() argument
329 if (!SU || !SU->getNode() || !SU->getNode()->isMachineOpcode()) in rawRegPressureDelta()
333 for (unsigned i = 0, e = SU->getNode()->getNumValues(); i != e; ++i) { in rawRegPressureDelta()
334 MVT VT = SU->getNode()->getSimpleValueType(i); in rawRegPressureDelta()
338 RegBalance += numberRCValSuccInSU(SU, RCId); in rawRegPressureDelta()
341 for (unsigned i = 0, e = SU->getNode()->getNumOperands(); i != e; ++i) { in rawRegPressureDelta()
342 const SDValue &Op = SU->getNode()->getOperand(i); in rawRegPressureDelta()
349 RegBalance -= numberRCValPredInSU(SU, RCId); in rawRegPressureDelta()
360 int ResourcePriorityQueue::regPressureDelta(SUnit *SU, bool RawPressure) { in regPressureDelta() argument
363 if (!SU || !SU->getNode() || !SU->getNode()->isMachineOpcode()) in regPressureDelta()
370 RegBalance += rawRegPressureDelta(SU, RC->getID()); in regPressureDelta()
378 rawRegPressureDelta(SU, RC->getID()) > 0) && in regPressureDelta()
380 rawRegPressureDelta(SU, RC->getID()) >= RegLimit[RC->getID()])) in regPressureDelta()
381 RegBalance += rawRegPressureDelta(SU, RC->getID()); in regPressureDelta()
401 int ResourcePriorityQueue::SUSchedulingCost(SUnit *SU) { in SUSchedulingCost() argument
406 if (SU->isScheduled) in SUSchedulingCost()
410 if (SU->isScheduleHigh) in SUSchedulingCost()
418 ResCount += (SU->getHeight() * ScaleTwo); in SUSchedulingCost()
421 if (isResourceAvailable(SU)) in SUSchedulingCost()
426 ResCount -= (regPressureDelta(SU,true) * ScaleOne); in SUSchedulingCost()
432 ResCount += (SU->getHeight() * ScaleTwo); in SUSchedulingCost()
434 ResCount += (NumNodesSolelyBlocking[SU->NodeNum] * ScaleTwo); in SUSchedulingCost()
437 if (isResourceAvailable(SU)) in SUSchedulingCost()
440 ResCount -= (regPressureDelta(SU) * ScaleTwo); in SUSchedulingCost()
446 for (SDNode *N = SU->getNode(); N; N = N->getGluedNode()) { in SUSchedulingCost()
471 void ResourcePriorityQueue::scheduledNode(SUnit *SU) { in scheduledNode() argument
474 if (!SU) { in scheduledNode()
480 const SDNode *ScegN = SU->getNode(); in scheduledNode()
491 RegPressure[RC->getID()] += numberRCValSuccInSU(SU, RC->getID()); in scheduledNode()
503 (numberRCValPredInSU(SU, RC->getID()))) in scheduledNode()
504 RegPressure[RC->getID()] -= numberRCValPredInSU(SU, RC->getID()); in scheduledNode()
509 for (SUnit::pred_iterator I = SU->Preds.begin(), E = SU->Preds.end(); in scheduledNode()
518 reserveResources(SU); in scheduledNode()
525 for (SUnit::const_succ_iterator I = SU->Succs.begin(), E = SU->Succs.end(); in scheduledNode()
533 if (ParallelLiveRanges >= SU->NumPreds) in scheduledNode()
534 ParallelLiveRanges -= SU->NumPreds; in scheduledNode()
540 ParallelLiveRanges += SU->NumRegDefsLeft; in scheduledNode()
543 HorizontalVerticalBalance += (SU->Succs.size() - numberCtrlDepsInSU(SU)); in scheduledNode()
544 HorizontalVerticalBalance -= (SU->Preds.size() - numberCtrlPredInSU(SU)); in scheduledNode()
547 void ResourcePriorityQueue::initNumRegDefsLeft(SUnit *SU) { in initNumRegDefsLeft() argument
549 for (SDNode *N = SU->getNode(); N; N = N->getGluedNode()) in initNumRegDefsLeft()
570 SU->NumRegDefsLeft = NodeNumDefs; in initNumRegDefsLeft()
579 void ResourcePriorityQueue::adjustPriorityOfUnscheduledPreds(SUnit *SU) { in adjustPriorityOfUnscheduledPreds() argument
580 if (SU->isAvailable) return; // All preds scheduled. in adjustPriorityOfUnscheduledPreds()
582 SUnit *OnlyAvailablePred = getSingleUnscheduledPred(SU); in adjustPriorityOfUnscheduledPreds()
632 void ResourcePriorityQueue::remove(SUnit *SU) { in remove() argument
634 std::vector<SUnit *>::iterator I = std::find(Queue.begin(), Queue.end(), SU); in remove()