diff options
author | Matthias Braun <matze@braunis.de> | 2016-04-22 19:10:15 +0000 |
---|---|---|
committer | Matthias Braun <matze@braunis.de> | 2016-04-22 19:10:15 +0000 |
commit | 4f57377c687f5c970c66f80956246e384a8ec4fd (patch) | |
tree | 9318a3ad362f6278d82ff3314418a57d2a940b80 /llvm/lib/CodeGen/MachineScheduler.cpp | |
parent | fe3def7c2a301ea414e0e7adf54e8216064268a0 (diff) | |
download | bcm5719-llvm-4f57377c687f5c970c66f80956246e384a8ec4fd.tar.gz bcm5719-llvm-4f57377c687f5c970c66f80956246e384a8ec4fd.zip |
MachineScheduler: Move code to initialize a Candidate out of tryCandidate(); NFC
llvm-svn: 267191
Diffstat (limited to 'llvm/lib/CodeGen/MachineScheduler.cpp')
-rw-r--r-- | llvm/lib/CodeGen/MachineScheduler.cpp | 66 |
1 files changed, 33 insertions, 33 deletions
diff --git a/llvm/lib/CodeGen/MachineScheduler.cpp b/llvm/lib/CodeGen/MachineScheduler.cpp index 927a03612de..c9ac05e778b 100644 --- a/llvm/lib/CodeGen/MachineScheduler.cpp +++ b/llvm/lib/CodeGen/MachineScheduler.cpp @@ -2738,54 +2738,54 @@ static int biasPhysRegCopy(const SUnit *SU, bool isTop) { return 0; } -/// Apply a set of heursitics to a new candidate. Heuristics are currently -/// hierarchical. This may be more efficient than a graduated cost model because -/// we don't need to evaluate all aspects of the model for each node in the -/// queue. But it's really done to make the heuristics easier to debug and -/// statistically analyze. -/// -/// \param Cand provides the policy and current best candidate. -/// \param TryCand refers to the next SUnit candidate, otherwise uninitialized. -/// \param Zone describes the scheduled zone that we are extending. -/// \param RPTracker describes reg pressure within the scheduled zone. -/// \param TempTracker is a scratch pressure tracker to reuse in queries. -void GenericScheduler::tryCandidate(SchedCandidate &Cand, - SchedCandidate &TryCand, - SchedBoundary &Zone, - const RegPressureTracker &RPTracker, - RegPressureTracker &TempTracker) { - +void GenericScheduler::initCandidate(SchedCandidate &Cand, SUnit *SU, + bool AtTop, + const RegPressureTracker &RPTracker, + RegPressureTracker &TempTracker) { + Cand.SU = SU; if (DAG->isTrackingPressure()) { - // Always initialize TryCand's RPDelta. - if (Zone.isTop()) { + if (AtTop) { TempTracker.getMaxDownwardPressureDelta( - TryCand.SU->getInstr(), - TryCand.RPDelta, + Cand.SU->getInstr(), + Cand.RPDelta, DAG->getRegionCriticalPSets(), DAG->getRegPressure().MaxSetPressure); } else { if (VerifyScheduling) { TempTracker.getMaxUpwardPressureDelta( - TryCand.SU->getInstr(), - &DAG->getPressureDiff(TryCand.SU), - TryCand.RPDelta, + Cand.SU->getInstr(), + &DAG->getPressureDiff(Cand.SU), + Cand.RPDelta, DAG->getRegionCriticalPSets(), DAG->getRegPressure().MaxSetPressure); } else { RPTracker.getUpwardPressureDelta( - TryCand.SU->getInstr(), - DAG->getPressureDiff(TryCand.SU), - TryCand.RPDelta, + Cand.SU->getInstr(), + DAG->getPressureDiff(Cand.SU), + Cand.RPDelta, DAG->getRegionCriticalPSets(), DAG->getRegPressure().MaxSetPressure); } } } - DEBUG(if (TryCand.RPDelta.Excess.isValid()) - dbgs() << " Try SU(" << TryCand.SU->NodeNum << ") " - << TRI->getRegPressureSetName(TryCand.RPDelta.Excess.getPSet()) - << ":" << TryCand.RPDelta.Excess.getUnitInc() << "\n"); + DEBUG(if (Cand.RPDelta.Excess.isValid()) + dbgs() << " Try SU(" << Cand.SU->NodeNum << ") " + << TRI->getRegPressureSetName(Cand.RPDelta.Excess.getPSet()) + << ":" << Cand.RPDelta.Excess.getUnitInc() << "\n"); +} +/// Apply a set of heursitics to a new candidate. Heuristics are currently +/// hierarchical. This may be more efficient than a graduated cost model because +/// we don't need to evaluate all aspects of the model for each node in the +/// queue. But it's really done to make the heuristics easier to debug and +/// statistically analyze. +/// +/// \param Cand provides the policy and current best candidate. +/// \param TryCand refers to the next SUnit candidate, otherwise uninitialized. +/// \param Zone describes the scheduled zone that we are extending. +void GenericScheduler::tryCandidate(SchedCandidate &Cand, + SchedCandidate &TryCand, + SchedBoundary &Zone) { // Initialize the candidate if needed. if (!Cand.isValid()) { TryCand.Reason = NodeOrder; @@ -2897,8 +2897,8 @@ void GenericScheduler::pickNodeFromQueue(SchedBoundary &Zone, for (ReadyQueue::iterator I = Q.begin(), E = Q.end(); I != E; ++I) { SchedCandidate TryCand(Cand.Policy); - TryCand.SU = *I; - tryCandidate(Cand, TryCand, Zone, RPTracker, TempTracker); + initCandidate(TryCand, *I, Zone.isTop(), RPTracker, TempTracker); + tryCandidate(Cand, TryCand, Zone); if (TryCand.Reason != NoCand) { // Initialize resource delta if needed in case future heuristics query it. if (TryCand.ResDelta == SchedResourceDelta()) |