Lines Matching defs:Cand

3113 void GenericSchedulerBase::traceCandidate(const SchedCandidate &Cand) {
3117 switch (Cand.Reason) {
3121 P = Cand.RPDelta.Excess;
3124 P = Cand.RPDelta.CriticalMax;
3127 P = Cand.RPDelta.CurrentMax;
3130 ResIdx = Cand.Policy.ReduceResIdx;
3133 ResIdx = Cand.Policy.DemandResIdx;
3136 Latency = Cand.SU->getDepth();
3139 Latency = Cand.SU->getHeight();
3142 Latency = Cand.SU->getHeight();
3145 Latency = Cand.SU->getDepth();
3148 dbgs() << " Cand SU(" << Cand.SU->NodeNum << ") " << getReasonStr(Cand.Reason);
3169 /// as we may need to differentiate whether TryCand is better than Cand.
3172 GenericSchedulerBase::SchedCandidate &Cand,
3179 if (Cand.Reason > Reason)
3180 Cand.Reason = Reason;
3188 GenericSchedulerBase::SchedCandidate &Cand,
3195 if (Cand.Reason > Reason)
3196 Cand.Reason = Reason;
3203 GenericSchedulerBase::SchedCandidate &Cand,
3209 if (std::max(TryCand.SU->getDepth(), Cand.SU->getDepth()) >
3211 if (tryLess(TryCand.SU->getDepth(), Cand.SU->getDepth(),
3212 TryCand, Cand, GenericSchedulerBase::TopDepthReduce))
3215 if (tryGreater(TryCand.SU->getHeight(), Cand.SU->getHeight(),
3216 TryCand, Cand, GenericSchedulerBase::TopPathReduce))
3222 if (std::max(TryCand.SU->getHeight(), Cand.SU->getHeight()) >
3224 if (tryLess(TryCand.SU->getHeight(), Cand.SU->getHeight(),
3225 TryCand, Cand, GenericSchedulerBase::BotHeightReduce))
3228 if (tryGreater(TryCand.SU->getDepth(), Cand.SU->getDepth(),
3229 TryCand, Cand, GenericSchedulerBase::BotPathReduce))
3241 static void tracePick(const GenericSchedulerBase::SchedCandidate &Cand) {
3242 tracePick(Cand.Reason, Cand.AtTop);
3392 GenericSchedulerBase::SchedCandidate &Cand,
3398 if (tryGreater(TryP.getUnitInc() < 0, CandP.getUnitInc() < 0, TryCand, Cand,
3404 if (Cand.AtTop != TryCand.AtTop)
3412 return tryLess(TryP.getUnitInc(), CandP.getUnitInc(), TryCand, Cand,
3425 return tryGreater(TryRank, CandRank, TryCand, Cand, Reason);
3476 void GenericScheduler::initCandidate(SchedCandidate &Cand, SUnit *SU,
3480 Cand.SU = SU;
3481 Cand.AtTop = AtTop;
3485 Cand.SU->getInstr(),
3486 Cand.RPDelta,
3492 Cand.SU->getInstr(),
3493 &DAG->getPressureDiff(Cand.SU),
3494 Cand.RPDelta,
3499 Cand.SU->getInstr(),
3500 DAG->getPressureDiff(Cand.SU),
3501 Cand.RPDelta,
3507 LLVM_DEBUG(if (Cand.RPDelta.Excess.isValid()) dbgs()
3508 << " Try SU(" << Cand.SU->NodeNum << ") "
3509 << TRI->getRegPressureSetName(Cand.RPDelta.Excess.getPSet()) << ":"
3510 << Cand.RPDelta.Excess.getUnitInc() << "\n");
3519 /// \param Cand provides the policy and current best candidate.
3522 /// if Cand is from a different zone than TryCand.
3523 /// \return \c true if TryCand is better than Cand (Reason is NOT NoCand)
3524 bool GenericScheduler::tryCandidate(SchedCandidate &Cand,
3528 if (!Cand.isValid()) {
3535 biasPhysReg(Cand.SU, Cand.AtTop), TryCand, Cand, PhysReg))
3540 Cand.RPDelta.Excess,
3541 TryCand, Cand, RegExcess, TRI,
3547 Cand.RPDelta.CriticalMax,
3548 TryCand, Cand, RegCritical, TRI,
3563 tryLatency(TryCand, Cand, *Zone))
3568 Zone->getLatencyStallCycles(Cand.SU), TryCand, Cand, Stall))
3579 Cand.AtTop ? DAG->getNextClusterSucc() : DAG->getNextClusterPred();
3583 Cand.SU == CandNextClusterSU,
3584 TryCand, Cand, Cluster))
3590 getWeakLeft(Cand.SU, Cand.AtTop),
3591 TryCand, Cand, Weak))
3597 Cand.RPDelta.CurrentMax,
3598 TryCand, Cand, RegMax, TRI,
3605 if (tryLess(TryCand.ResDelta.CritResources, Cand.ResDelta.CritResources,
3606 TryCand, Cand, ResourceReduce))
3609 Cand.ResDelta.DemandedResources,
3610 TryCand, Cand, ResourceDemand))
3616 !Rem.IsAcyclicLatencyLimited && tryLatency(TryCand, Cand, *Zone))
3620 if ((Zone->isTop() && TryCand.SU->NodeNum < Cand.SU->NodeNum)
3621 || (!Zone->isTop() && TryCand.SU->NodeNum > Cand.SU->NodeNum)) {
3638 SchedCandidate &Cand) {
3648 SchedBoundary *ZoneArg = Cand.AtTop == TryCand.AtTop ? &Zone : nullptr;
3649 if (tryCandidate(Cand, TryCand, ZoneArg)) {
3653 Cand.setBest(TryCand);
3654 LLVM_DEBUG(traceCandidate(Cand));
3725 SchedCandidate Cand = BotCand;
3727 if (tryCandidate(Cand, TopCand, nullptr)) {
3728 Cand.setBest(TopCand);
3729 LLVM_DEBUG(traceCandidate(Cand));
3732 IsTopNode = Cand.AtTop;
3733 tracePick(Cand);
3734 return Cand.SU;
3937 /// \param Cand provides the policy and current best candidate.
3939 /// \return \c true if TryCand is better than Cand (Reason is NOT NoCand)
3940 bool PostGenericScheduler::tryCandidate(SchedCandidate &Cand,
3943 if (!Cand.isValid()) {
3950 Top.getLatencyStallCycles(Cand.SU), TryCand, Cand, Stall))
3955 Cand.AtTop ? DAG->getNextClusterSucc() : DAG->getNextClusterPred();
3959 Cand.SU == CandNextClusterSU, TryCand, Cand, Cluster))
3963 if (tryLess(TryCand.ResDelta.CritResources, Cand.ResDelta.CritResources,
3964 TryCand, Cand, ResourceReduce))
3967 Cand.ResDelta.DemandedResources,
3968 TryCand, Cand, ResourceDemand))
3973 if (Cand.AtTop == TryCand.AtTop) {
3975 if (Cand.Policy.ReduceLatency &&
3976 tryLatency(TryCand, Cand, Cand.AtTop ? Top : Bot))
3981 if (TryCand.SU->NodeNum < Cand.SU->NodeNum) {
3990 SchedCandidate &Cand) {
3993 SchedCandidate TryCand(Cand.Policy);
3997 if (tryCandidate(Cand, TryCand)) {
3998 Cand.setBest(TryCand);
3999 LLVM_DEBUG(traceCandidate(Cand));
4073 SchedCandidate Cand = BotCand;
4075 if (tryCandidate(Cand, TopCand)) {
4076 Cand.setBest(TopCand);
4077 LLVM_DEBUG(traceCandidate(Cand));
4080 IsTopNode = Cand.AtTop;
4081 tracePick(Cand);
4082 return Cand.SU;