Changeset View
Changeset View
Standalone View
Standalone View
llvm/trunk/lib/Target/AMDGPU/GCNSchedStrategy.cpp
Show First 20 Lines • Show All 190 Lines • ▼ Show 20 Lines | SUnit *GCNMaxOccupancySchedStrategy::pickNodeBidirectional(bool &IsTopNode) { | ||||
LLVM_DEBUG(dbgs() << "Picking from Bot:\n"); | LLVM_DEBUG(dbgs() << "Picking from Bot:\n"); | ||||
if (!BotCand.isValid() || BotCand.SU->isScheduled || | if (!BotCand.isValid() || BotCand.SU->isScheduled || | ||||
BotCand.Policy != BotPolicy) { | BotCand.Policy != BotPolicy) { | ||||
BotCand.reset(CandPolicy()); | BotCand.reset(CandPolicy()); | ||||
pickNodeFromQueue(Bot, BotPolicy, DAG->getBotRPTracker(), BotCand); | pickNodeFromQueue(Bot, BotPolicy, DAG->getBotRPTracker(), BotCand); | ||||
assert(BotCand.Reason != NoCand && "failed to find the first candidate"); | assert(BotCand.Reason != NoCand && "failed to find the first candidate"); | ||||
} else { | } else { | ||||
LLVM_DEBUG(traceCandidate(BotCand)); | LLVM_DEBUG(traceCandidate(BotCand)); | ||||
#ifndef NDEBUG | |||||
if (VerifyScheduling) { | |||||
SchedCandidate TCand; | |||||
TCand.reset(CandPolicy()); | |||||
pickNodeFromQueue(Bot, BotPolicy, DAG->getBotRPTracker(), TCand); | |||||
assert(TCand.SU == BotCand.SU && | |||||
"Last pick result should correspond to re-picking right now"); | |||||
} | |||||
#endif | |||||
} | } | ||||
// Check if the top Q has a better candidate. | // Check if the top Q has a better candidate. | ||||
LLVM_DEBUG(dbgs() << "Picking from Top:\n"); | LLVM_DEBUG(dbgs() << "Picking from Top:\n"); | ||||
if (!TopCand.isValid() || TopCand.SU->isScheduled || | if (!TopCand.isValid() || TopCand.SU->isScheduled || | ||||
TopCand.Policy != TopPolicy) { | TopCand.Policy != TopPolicy) { | ||||
TopCand.reset(CandPolicy()); | TopCand.reset(CandPolicy()); | ||||
pickNodeFromQueue(Top, TopPolicy, DAG->getTopRPTracker(), TopCand); | pickNodeFromQueue(Top, TopPolicy, DAG->getTopRPTracker(), TopCand); | ||||
assert(TopCand.Reason != NoCand && "failed to find the first candidate"); | assert(TopCand.Reason != NoCand && "failed to find the first candidate"); | ||||
} else { | } else { | ||||
LLVM_DEBUG(traceCandidate(TopCand)); | LLVM_DEBUG(traceCandidate(TopCand)); | ||||
#ifndef NDEBUG | |||||
if (VerifyScheduling) { | |||||
SchedCandidate TCand; | |||||
TCand.reset(CandPolicy()); | |||||
pickNodeFromQueue(Top, TopPolicy, DAG->getTopRPTracker(), TCand); | |||||
assert(TCand.SU == TopCand.SU && | |||||
"Last pick result should correspond to re-picking right now"); | |||||
} | |||||
#endif | |||||
} | } | ||||
// Pick best from BotCand and TopCand. | // Pick best from BotCand and TopCand. | ||||
LLVM_DEBUG(dbgs() << "Top Cand: "; traceCandidate(TopCand); | LLVM_DEBUG(dbgs() << "Top Cand: "; traceCandidate(TopCand); | ||||
dbgs() << "Bot Cand: "; traceCandidate(BotCand);); | dbgs() << "Bot Cand: "; traceCandidate(BotCand);); | ||||
SchedCandidate Cand; | SchedCandidate Cand; | ||||
if (TopCand.Reason == BotCand.Reason) { | if (TopCand.Reason == BotCand.Reason) { | ||||
Cand = BotCand; | Cand = BotCand; | ||||
▲ Show 20 Lines • Show All 354 Lines • Show Last 20 Lines |