1 //===----- SchedulePostRAList.cpp - list scheduler ------------------------===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 // This implements a top-down list scheduler, using standard algorithms.
11 // The basic approach uses a priority queue of available nodes to schedule.
12 // One at a time, nodes are taken from the priority queue (thus in priority
13 // order), checked for legality to schedule, and emitted if legal.
15 // Nodes may not be legal to schedule either due to structural hazards (e.g.
16 // pipeline or resource constraints) or because an input to the instruction has
17 // not completed execution.
19 //===----------------------------------------------------------------------===//
21 #define DEBUG_TYPE "post-RA-sched"
22 #include "AntiDepBreaker.h"
23 #include "AggressiveAntiDepBreaker.h"
24 #include "CriticalAntiDepBreaker.h"
25 #include "RegisterClassInfo.h"
26 #include "ScheduleDAGInstrs.h"
27 #include "llvm/CodeGen/Passes.h"
28 #include "llvm/CodeGen/LatencyPriorityQueue.h"
29 #include "llvm/CodeGen/SchedulerRegistry.h"
30 #include "llvm/CodeGen/MachineDominators.h"
31 #include "llvm/CodeGen/MachineFrameInfo.h"
32 #include "llvm/CodeGen/MachineFunctionPass.h"
33 #include "llvm/CodeGen/MachineLoopInfo.h"
34 #include "llvm/CodeGen/MachineRegisterInfo.h"
35 #include "llvm/CodeGen/ScheduleHazardRecognizer.h"
36 #include "llvm/Analysis/AliasAnalysis.h"
37 #include "llvm/Target/TargetLowering.h"
38 #include "llvm/Target/TargetMachine.h"
39 #include "llvm/Target/TargetInstrInfo.h"
40 #include "llvm/Target/TargetRegisterInfo.h"
41 #include "llvm/Target/TargetSubtargetInfo.h"
42 #include "llvm/Support/CommandLine.h"
43 #include "llvm/Support/Debug.h"
44 #include "llvm/Support/ErrorHandling.h"
45 #include "llvm/Support/raw_ostream.h"
46 #include "llvm/ADT/BitVector.h"
47 #include "llvm/ADT/Statistic.h"
51 STATISTIC(NumNoops, "Number of noops inserted");
52 STATISTIC(NumStalls, "Number of pipeline stalls");
53 STATISTIC(NumFixedAnti, "Number of fixed anti-dependencies");
55 // Post-RA scheduling is enabled with
56 // TargetSubtargetInfo.enablePostRAScheduler(). This flag can be used to
57 // override the target.
59 EnablePostRAScheduler("post-RA-scheduler",
60 cl::desc("Enable scheduling after register allocation"),
61 cl::init(false), cl::Hidden);
62 static cl::opt<std::string>
63 EnableAntiDepBreaking("break-anti-dependencies",
64 cl::desc("Break post-RA scheduling anti-dependencies: "
65 "\"critical\", \"all\", or \"none\""),
66 cl::init("none"), cl::Hidden);
68 // If DebugDiv > 0 then only schedule MBB with (ID % DebugDiv) == DebugMod
70 DebugDiv("postra-sched-debugdiv",
71 cl::desc("Debug control MBBs that are scheduled"),
72 cl::init(0), cl::Hidden);
74 DebugMod("postra-sched-debugmod",
75 cl::desc("Debug control MBBs that are scheduled"),
76 cl::init(0), cl::Hidden);
78 AntiDepBreaker::~AntiDepBreaker() { }
81 class PostRAScheduler : public MachineFunctionPass {
83 const TargetInstrInfo *TII;
84 RegisterClassInfo RegClassInfo;
85 CodeGenOpt::Level OptLevel;
89 PostRAScheduler(CodeGenOpt::Level ol) :
90 MachineFunctionPass(ID), OptLevel(ol) {}
92 void getAnalysisUsage(AnalysisUsage &AU) const {
94 AU.addRequired<AliasAnalysis>();
95 AU.addRequired<MachineDominatorTree>();
96 AU.addPreserved<MachineDominatorTree>();
97 AU.addRequired<MachineLoopInfo>();
98 AU.addPreserved<MachineLoopInfo>();
99 MachineFunctionPass::getAnalysisUsage(AU);
102 const char *getPassName() const {
103 return "Post RA top-down list latency scheduler";
106 bool runOnMachineFunction(MachineFunction &Fn);
108 char PostRAScheduler::ID = 0;
110 class SchedulePostRATDList : public ScheduleDAGInstrs {
111 /// AvailableQueue - The priority queue to use for the available SUnits.
113 LatencyPriorityQueue AvailableQueue;
115 /// PendingQueue - This contains all of the instructions whose operands have
116 /// been issued, but their results are not ready yet (due to the latency of
117 /// the operation). Once the operands becomes available, the instruction is
118 /// added to the AvailableQueue.
119 std::vector<SUnit*> PendingQueue;
121 /// Topo - A topological ordering for SUnits.
122 ScheduleDAGTopologicalSort Topo;
124 /// HazardRec - The hazard recognizer to use.
125 ScheduleHazardRecognizer *HazardRec;
127 /// AntiDepBreak - Anti-dependence breaking object, or NULL if none
128 AntiDepBreaker *AntiDepBreak;
130 /// AA - AliasAnalysis for making memory reference queries.
133 /// KillIndices - The index of the most recent kill (proceding bottom-up),
134 /// or ~0u if the register is not live.
135 std::vector<unsigned> KillIndices;
138 SchedulePostRATDList(
139 MachineFunction &MF, MachineLoopInfo &MLI, MachineDominatorTree &MDT,
140 AliasAnalysis *AA, const RegisterClassInfo&,
141 TargetSubtargetInfo::AntiDepBreakMode AntiDepMode,
142 SmallVectorImpl<TargetRegisterClass*> &CriticalPathRCs);
144 ~SchedulePostRATDList();
146 /// StartBlock - Initialize register live-range state for scheduling in
149 void StartBlock(MachineBasicBlock *BB);
151 /// Schedule - Schedule the instruction range using list scheduling.
155 /// Observe - Update liveness information to account for the current
156 /// instruction, which will not be scheduled.
158 void Observe(MachineInstr *MI, unsigned Count);
160 /// FinishBlock - Clean up register live-range state.
164 /// FixupKills - Fix register kill flags that have been made
165 /// invalid due to scheduling
167 void FixupKills(MachineBasicBlock *MBB);
170 void ReleaseSucc(SUnit *SU, SDep *SuccEdge);
171 void ReleaseSuccessors(SUnit *SU);
172 void ScheduleNodeTopDown(SUnit *SU, unsigned CurCycle);
173 void ListScheduleTopDown();
174 void StartBlockForKills(MachineBasicBlock *BB);
176 // ToggleKillFlag - Toggle a register operand kill flag. Other
177 // adjustments may be made to the instruction if necessary. Return
178 // true if the operand has been deleted, false if not.
179 bool ToggleKillFlag(MachineInstr *MI, MachineOperand &MO);
183 SchedulePostRATDList::SchedulePostRATDList(
184 MachineFunction &MF, MachineLoopInfo &MLI, MachineDominatorTree &MDT,
185 AliasAnalysis *AA, const RegisterClassInfo &RCI,
186 TargetSubtargetInfo::AntiDepBreakMode AntiDepMode,
187 SmallVectorImpl<TargetRegisterClass*> &CriticalPathRCs)
188 : ScheduleDAGInstrs(MF, MLI, MDT), Topo(SUnits), AA(AA),
189 KillIndices(TRI->getNumRegs())
191 const TargetMachine &TM = MF.getTarget();
192 const InstrItineraryData *InstrItins = TM.getInstrItineraryData();
194 TM.getInstrInfo()->CreateTargetPostRAHazardRecognizer(InstrItins, this);
196 ((AntiDepMode == TargetSubtargetInfo::ANTIDEP_ALL) ?
197 (AntiDepBreaker *)new AggressiveAntiDepBreaker(MF, RCI, CriticalPathRCs) :
198 ((AntiDepMode == TargetSubtargetInfo::ANTIDEP_CRITICAL) ?
199 (AntiDepBreaker *)new CriticalAntiDepBreaker(MF, RCI) : NULL));
202 SchedulePostRATDList::~SchedulePostRATDList() {
207 bool PostRAScheduler::runOnMachineFunction(MachineFunction &Fn) {
208 TII = Fn.getTarget().getInstrInfo();
209 MachineLoopInfo &MLI = getAnalysis<MachineLoopInfo>();
210 MachineDominatorTree &MDT = getAnalysis<MachineDominatorTree>();
211 AliasAnalysis *AA = &getAnalysis<AliasAnalysis>();
212 RegClassInfo.runOnMachineFunction(Fn);
214 // Check for explicit enable/disable of post-ra scheduling.
215 TargetSubtargetInfo::AntiDepBreakMode AntiDepMode =
216 TargetSubtargetInfo::ANTIDEP_NONE;
217 SmallVector<TargetRegisterClass*, 4> CriticalPathRCs;
218 if (EnablePostRAScheduler.getPosition() > 0) {
219 if (!EnablePostRAScheduler)
222 // Check that post-RA scheduling is enabled for this target.
223 // This may upgrade the AntiDepMode.
224 const TargetSubtargetInfo &ST = Fn.getTarget().getSubtarget<TargetSubtargetInfo>();
225 if (!ST.enablePostRAScheduler(OptLevel, AntiDepMode, CriticalPathRCs))
229 // Check for antidep breaking override...
230 if (EnableAntiDepBreaking.getPosition() > 0) {
231 AntiDepMode = (EnableAntiDepBreaking == "all")
232 ? TargetSubtargetInfo::ANTIDEP_ALL
233 : ((EnableAntiDepBreaking == "critical")
234 ? TargetSubtargetInfo::ANTIDEP_CRITICAL
235 : TargetSubtargetInfo::ANTIDEP_NONE);
238 DEBUG(dbgs() << "PostRAScheduler\n");
240 SchedulePostRATDList Scheduler(Fn, MLI, MDT, AA, RegClassInfo, AntiDepMode,
243 // Loop over all of the basic blocks
244 for (MachineFunction::iterator MBB = Fn.begin(), MBBe = Fn.end();
245 MBB != MBBe; ++MBB) {
247 // If DebugDiv > 0 then only schedule MBB with (ID % DebugDiv) == DebugMod
249 static int bbcnt = 0;
250 if (bbcnt++ % DebugDiv != DebugMod)
252 dbgs() << "*** DEBUG scheduling " << Fn.getFunction()->getName()
253 << ":BB#" << MBB->getNumber() << " ***\n";
257 // Initialize register live-range state for scheduling in this block.
258 Scheduler.StartBlock(MBB);
260 // Schedule each sequence of instructions not interrupted by a label
261 // or anything else that effectively needs to shut down scheduling.
262 MachineBasicBlock::iterator Current = MBB->end();
263 unsigned Count = MBB->size(), CurrentCount = Count;
264 for (MachineBasicBlock::iterator I = Current; I != MBB->begin(); ) {
265 MachineInstr *MI = llvm::prior(I);
266 if (TII->isSchedulingBoundary(MI, MBB, Fn)) {
267 Scheduler.Run(MBB, I, Current, CurrentCount);
268 Scheduler.EmitSchedule();
270 CurrentCount = Count - 1;
271 Scheduler.Observe(MI, CurrentCount);
276 Count -= MI->getBundleSize();
278 assert(Count == 0 && "Instruction count mismatch!");
279 assert((MBB->begin() == Current || CurrentCount != 0) &&
280 "Instruction count mismatch!");
281 Scheduler.Run(MBB, MBB->begin(), Current, CurrentCount);
282 Scheduler.EmitSchedule();
284 // Clean up register live-range state.
285 Scheduler.FinishBlock();
287 // Update register kills
288 Scheduler.FixupKills(MBB);
294 /// StartBlock - Initialize register live-range state for scheduling in
297 void SchedulePostRATDList::StartBlock(MachineBasicBlock *BB) {
298 // Call the superclass.
299 ScheduleDAGInstrs::StartBlock(BB);
301 // Reset the hazard recognizer and anti-dep breaker.
303 if (AntiDepBreak != NULL)
304 AntiDepBreak->StartBlock(BB);
307 /// Schedule - Schedule the instruction range using list scheduling.
309 void SchedulePostRATDList::Schedule() {
310 // Build the scheduling graph.
313 if (AntiDepBreak != NULL) {
315 AntiDepBreak->BreakAntiDependencies(SUnits, Begin, InsertPos,
316 InsertPosIndex, DbgValues);
319 // We made changes. Update the dependency graph.
320 // Theoretically we could update the graph in place:
321 // When a live range is changed to use a different register, remove
322 // the def's anti-dependence *and* output-dependence edges due to
323 // that register, and add new anti-dependence and output-dependence
324 // edges based on the next live range of the register.
331 NumFixedAnti += Broken;
335 DEBUG(dbgs() << "********** List Scheduling **********\n");
336 DEBUG(for (unsigned su = 0, e = SUnits.size(); su != e; ++su)
337 SUnits[su].dumpAll(this));
339 AvailableQueue.initNodes(SUnits);
340 ListScheduleTopDown();
341 AvailableQueue.releaseState();
344 /// Observe - Update liveness information to account for the current
345 /// instruction, which will not be scheduled.
347 void SchedulePostRATDList::Observe(MachineInstr *MI, unsigned Count) {
348 if (AntiDepBreak != NULL)
349 AntiDepBreak->Observe(MI, Count, InsertPosIndex);
352 /// FinishBlock - Clean up register live-range state.
354 void SchedulePostRATDList::FinishBlock() {
355 if (AntiDepBreak != NULL)
356 AntiDepBreak->FinishBlock();
358 // Call the superclass.
359 ScheduleDAGInstrs::FinishBlock();
362 /// StartBlockForKills - Initialize register live-range state for updating kills
364 void SchedulePostRATDList::StartBlockForKills(MachineBasicBlock *BB) {
365 // Initialize the indices to indicate that no registers are live.
366 for (unsigned i = 0; i < TRI->getNumRegs(); ++i)
367 KillIndices[i] = ~0u;
369 // Determine the live-out physregs for this block.
370 if (!BB->empty() && BB->back().isReturn()) {
371 // In a return block, examine the function live-out regs.
372 for (MachineRegisterInfo::liveout_iterator I = MRI.liveout_begin(),
373 E = MRI.liveout_end(); I != E; ++I) {
375 KillIndices[Reg] = BB->size();
376 // Repeat, for all subregs.
377 for (const unsigned *Subreg = TRI->getSubRegisters(Reg);
379 KillIndices[*Subreg] = BB->size();
384 // In a non-return block, examine the live-in regs of all successors.
385 for (MachineBasicBlock::succ_iterator SI = BB->succ_begin(),
386 SE = BB->succ_end(); SI != SE; ++SI) {
387 for (MachineBasicBlock::livein_iterator I = (*SI)->livein_begin(),
388 E = (*SI)->livein_end(); I != E; ++I) {
390 KillIndices[Reg] = BB->size();
391 // Repeat, for all subregs.
392 for (const unsigned *Subreg = TRI->getSubRegisters(Reg);
394 KillIndices[*Subreg] = BB->size();
401 bool SchedulePostRATDList::ToggleKillFlag(MachineInstr *MI,
402 MachineOperand &MO) {
403 // Setting kill flag...
409 // If MO itself is live, clear the kill flag...
410 if (KillIndices[MO.getReg()] != ~0u) {
415 // If any subreg of MO is live, then create an imp-def for that
416 // subreg and keep MO marked as killed.
419 const unsigned SuperReg = MO.getReg();
420 for (const unsigned *Subreg = TRI->getSubRegisters(SuperReg);
422 if (KillIndices[*Subreg] != ~0u) {
423 MI->addOperand(MachineOperand::CreateReg(*Subreg,
437 /// FixupKills - Fix the register kill flags, they may have been made
438 /// incorrect by instruction reordering.
440 void SchedulePostRATDList::FixupKills(MachineBasicBlock *MBB) {
441 DEBUG(dbgs() << "Fixup kills for BB#" << MBB->getNumber() << '\n');
443 std::set<unsigned> killedRegs;
444 BitVector ReservedRegs = TRI->getReservedRegs(MF);
446 StartBlockForKills(MBB);
448 // Examine block from end to start...
449 unsigned Count = MBB->size();
450 for (MachineBasicBlock::iterator I = MBB->end(), E = MBB->begin();
452 MachineInstr *MI = --I;
453 if (MI->isDebugValue())
456 // Update liveness. Registers that are defed but not used in this
457 // instruction are now dead. Mark register and all subregs as they
458 // are completely defined.
459 for (unsigned i = 0, e = MI->getNumOperands(); i != e; ++i) {
460 MachineOperand &MO = MI->getOperand(i);
461 if (!MO.isReg()) continue;
462 unsigned Reg = MO.getReg();
463 if (Reg == 0) continue;
464 if (!MO.isDef()) continue;
465 // Ignore two-addr defs.
466 if (MI->isRegTiedToUseOperand(i)) continue;
468 KillIndices[Reg] = ~0u;
470 // Repeat for all subregs.
471 for (const unsigned *Subreg = TRI->getSubRegisters(Reg);
473 KillIndices[*Subreg] = ~0u;
477 // Examine all used registers and set/clear kill flag. When a
478 // register is used multiple times we only set the kill flag on
481 for (unsigned i = 0, e = MI->getNumOperands(); i != e; ++i) {
482 MachineOperand &MO = MI->getOperand(i);
483 if (!MO.isReg() || !MO.isUse()) continue;
484 unsigned Reg = MO.getReg();
485 if ((Reg == 0) || ReservedRegs.test(Reg)) continue;
488 if (killedRegs.find(Reg) == killedRegs.end()) {
490 // A register is not killed if any subregs are live...
491 for (const unsigned *Subreg = TRI->getSubRegisters(Reg);
493 if (KillIndices[*Subreg] != ~0u) {
499 // If subreg is not live, then register is killed if it became
500 // live in this instruction
502 kill = (KillIndices[Reg] == ~0u);
505 if (MO.isKill() != kill) {
506 DEBUG(dbgs() << "Fixing " << MO << " in ");
507 // Warning: ToggleKillFlag may invalidate MO.
508 ToggleKillFlag(MI, MO);
512 killedRegs.insert(Reg);
515 // Mark any used register (that is not using undef) and subregs as
517 for (unsigned i = 0, e = MI->getNumOperands(); i != e; ++i) {
518 MachineOperand &MO = MI->getOperand(i);
519 if (!MO.isReg() || !MO.isUse() || MO.isUndef()) continue;
520 unsigned Reg = MO.getReg();
521 if ((Reg == 0) || ReservedRegs.test(Reg)) continue;
523 KillIndices[Reg] = Count;
525 for (const unsigned *Subreg = TRI->getSubRegisters(Reg);
527 KillIndices[*Subreg] = Count;
533 //===----------------------------------------------------------------------===//
534 // Top-Down Scheduling
535 //===----------------------------------------------------------------------===//
537 /// ReleaseSucc - Decrement the NumPredsLeft count of a successor. Add it to
538 /// the PendingQueue if the count reaches zero. Also update its cycle bound.
539 void SchedulePostRATDList::ReleaseSucc(SUnit *SU, SDep *SuccEdge) {
540 SUnit *SuccSU = SuccEdge->getSUnit();
543 if (SuccSU->NumPredsLeft == 0) {
544 dbgs() << "*** Scheduling failed! ***\n";
546 dbgs() << " has been released too many times!\n";
550 --SuccSU->NumPredsLeft;
552 // Standard scheduler algorithms will recompute the depth of the successor
554 // SuccSU->setDepthToAtLeast(SU->getDepth() + SuccEdge->getLatency());
556 // However, we lazily compute node depth instead. Note that
557 // ScheduleNodeTopDown has already updated the depth of this node which causes
558 // all descendents to be marked dirty. Setting the successor depth explicitly
559 // here would cause depth to be recomputed for all its ancestors. If the
560 // successor is not yet ready (because of a transitively redundant edge) then
561 // this causes depth computation to be quadratic in the size of the DAG.
563 // If all the node's predecessors are scheduled, this node is ready
564 // to be scheduled. Ignore the special ExitSU node.
565 if (SuccSU->NumPredsLeft == 0 && SuccSU != &ExitSU)
566 PendingQueue.push_back(SuccSU);
569 /// ReleaseSuccessors - Call ReleaseSucc on each of SU's successors.
570 void SchedulePostRATDList::ReleaseSuccessors(SUnit *SU) {
571 for (SUnit::succ_iterator I = SU->Succs.begin(), E = SU->Succs.end();
573 ReleaseSucc(SU, &*I);
577 /// ScheduleNodeTopDown - Add the node to the schedule. Decrement the pending
578 /// count of its successors. If a successor pending count is zero, add it to
579 /// the Available queue.
580 void SchedulePostRATDList::ScheduleNodeTopDown(SUnit *SU, unsigned CurCycle) {
581 DEBUG(dbgs() << "*** Scheduling [" << CurCycle << "]: ");
582 DEBUG(SU->dump(this));
584 Sequence.push_back(SU);
585 assert(CurCycle >= SU->getDepth() &&
586 "Node scheduled above its depth!");
587 SU->setDepthToAtLeast(CurCycle);
589 ReleaseSuccessors(SU);
590 SU->isScheduled = true;
591 AvailableQueue.ScheduledNode(SU);
594 /// ListScheduleTopDown - The main loop of list scheduling for top-down
596 void SchedulePostRATDList::ListScheduleTopDown() {
597 unsigned CurCycle = 0;
599 // We're scheduling top-down but we're visiting the regions in
600 // bottom-up order, so we don't know the hazards at the start of a
601 // region. So assume no hazards (this should usually be ok as most
602 // blocks are a single region).
605 // Release any successors of the special Entry node.
606 ReleaseSuccessors(&EntrySU);
608 // Add all leaves to Available queue.
609 for (unsigned i = 0, e = SUnits.size(); i != e; ++i) {
610 // It is available if it has no predecessors.
611 bool available = SUnits[i].Preds.empty();
613 AvailableQueue.push(&SUnits[i]);
614 SUnits[i].isAvailable = true;
618 // In any cycle where we can't schedule any instructions, we must
619 // stall or emit a noop, depending on the target.
620 bool CycleHasInsts = false;
622 // While Available queue is not empty, grab the node with the highest
623 // priority. If it is not ready put it back. Schedule the node.
624 std::vector<SUnit*> NotReady;
625 Sequence.reserve(SUnits.size());
626 while (!AvailableQueue.empty() || !PendingQueue.empty()) {
627 // Check to see if any of the pending instructions are ready to issue. If
628 // so, add them to the available queue.
629 unsigned MinDepth = ~0u;
630 for (unsigned i = 0, e = PendingQueue.size(); i != e; ++i) {
631 if (PendingQueue[i]->getDepth() <= CurCycle) {
632 AvailableQueue.push(PendingQueue[i]);
633 PendingQueue[i]->isAvailable = true;
634 PendingQueue[i] = PendingQueue.back();
635 PendingQueue.pop_back();
637 } else if (PendingQueue[i]->getDepth() < MinDepth)
638 MinDepth = PendingQueue[i]->getDepth();
641 DEBUG(dbgs() << "\n*** Examining Available\n"; AvailableQueue.dump(this));
643 SUnit *FoundSUnit = 0;
644 bool HasNoopHazards = false;
645 while (!AvailableQueue.empty()) {
646 SUnit *CurSUnit = AvailableQueue.pop();
648 ScheduleHazardRecognizer::HazardType HT =
649 HazardRec->getHazardType(CurSUnit, 0/*no stalls*/);
650 if (HT == ScheduleHazardRecognizer::NoHazard) {
651 FoundSUnit = CurSUnit;
655 // Remember if this is a noop hazard.
656 HasNoopHazards |= HT == ScheduleHazardRecognizer::NoopHazard;
658 NotReady.push_back(CurSUnit);
661 // Add the nodes that aren't ready back onto the available list.
662 if (!NotReady.empty()) {
663 AvailableQueue.push_all(NotReady);
667 // If we found a node to schedule...
669 // ... schedule the node...
670 ScheduleNodeTopDown(FoundSUnit, CurCycle);
671 HazardRec->EmitInstruction(FoundSUnit);
672 CycleHasInsts = true;
673 if (HazardRec->atIssueLimit()) {
674 DEBUG(dbgs() << "*** Max instructions per cycle " << CurCycle << '\n');
675 HazardRec->AdvanceCycle();
677 CycleHasInsts = false;
681 DEBUG(dbgs() << "*** Finished cycle " << CurCycle << '\n');
682 HazardRec->AdvanceCycle();
683 } else if (!HasNoopHazards) {
684 // Otherwise, we have a pipeline stall, but no other problem,
685 // just advance the current cycle and try again.
686 DEBUG(dbgs() << "*** Stall in cycle " << CurCycle << '\n');
687 HazardRec->AdvanceCycle();
690 // Otherwise, we have no instructions to issue and we have instructions
691 // that will fault if we don't do this right. This is the case for
692 // processors without pipeline interlocks and other cases.
693 DEBUG(dbgs() << "*** Emitting noop in cycle " << CurCycle << '\n');
694 HazardRec->EmitNoop();
695 Sequence.push_back(0); // NULL here means noop
700 CycleHasInsts = false;
705 VerifySchedule(/*isBottomUp=*/false);
709 //===----------------------------------------------------------------------===//
710 // Public Constructor Functions
711 //===----------------------------------------------------------------------===//
713 FunctionPass *llvm::createPostRAScheduler(CodeGenOpt::Level OptLevel) {
714 return new PostRAScheduler(OptLevel);