blob: bb4b89fd7fa9a851df17a0f86a02bc50c8470159 [file] [log] [blame]
Andrew Trick96f678f2012-01-13 06:30:30 +00001//===- MachineScheduler.cpp - Machine Instruction Scheduler ---------------===//
2//
3// The LLVM Compiler Infrastructure
4//
5// This file is distributed under the University of Illinois Open Source
6// License. See LICENSE.TXT for details.
7//
8//===----------------------------------------------------------------------===//
9//
10// MachineScheduler schedules machine instructions after phi elimination. It
11// preserves LiveIntervals so it can be invoked before register allocation.
12//
13//===----------------------------------------------------------------------===//
14
15#define DEBUG_TYPE "misched"
16
Andrew Trick96f678f2012-01-13 06:30:30 +000017#include "llvm/CodeGen/LiveIntervalAnalysis.h"
Andrew Trickc174eaf2012-03-08 01:41:12 +000018#include "llvm/CodeGen/MachineScheduler.h"
Andrew Trick96f678f2012-01-13 06:30:30 +000019#include "llvm/CodeGen/Passes.h"
Andrew Tricked395c82012-03-07 23:01:06 +000020#include "llvm/CodeGen/ScheduleDAGInstrs.h"
Andrew Trick96f678f2012-01-13 06:30:30 +000021#include "llvm/Analysis/AliasAnalysis.h"
Andrew Tricke9ef4ed2012-01-14 02:17:09 +000022#include "llvm/Target/TargetInstrInfo.h"
Andrew Trick96f678f2012-01-13 06:30:30 +000023#include "llvm/Support/CommandLine.h"
24#include "llvm/Support/Debug.h"
25#include "llvm/Support/ErrorHandling.h"
26#include "llvm/Support/raw_ostream.h"
27#include "llvm/ADT/OwningPtr.h"
28
Andrew Trickc6cf11b2012-01-17 06:55:07 +000029#include <queue>
30
Andrew Trick96f678f2012-01-13 06:30:30 +000031using namespace llvm;
32
Andrew Trick0df7f882012-03-07 00:18:25 +000033#ifndef NDEBUG
34static cl::opt<bool> ViewMISchedDAGs("view-misched-dags", cl::Hidden,
35 cl::desc("Pop up a window to show MISched dags after they are processed"));
36#else
37static bool ViewMISchedDAGs = false;
38#endif // NDEBUG
39
Andrew Trick5edf2f02012-01-14 02:17:06 +000040//===----------------------------------------------------------------------===//
41// Machine Instruction Scheduling Pass and Registry
42//===----------------------------------------------------------------------===//
43
Andrew Trick96f678f2012-01-13 06:30:30 +000044namespace {
Andrew Trick42b7a712012-01-17 06:55:03 +000045/// MachineScheduler runs after coalescing and before register allocation.
Andrew Trickc174eaf2012-03-08 01:41:12 +000046class MachineScheduler : public MachineSchedContext,
47 public MachineFunctionPass {
Andrew Trick96f678f2012-01-13 06:30:30 +000048public:
Andrew Trick42b7a712012-01-17 06:55:03 +000049 MachineScheduler();
Andrew Trick96f678f2012-01-13 06:30:30 +000050
51 virtual void getAnalysisUsage(AnalysisUsage &AU) const;
52
53 virtual void releaseMemory() {}
54
55 virtual bool runOnMachineFunction(MachineFunction&);
56
57 virtual void print(raw_ostream &O, const Module* = 0) const;
58
59 static char ID; // Class identification, replacement for typeinfo
60};
61} // namespace
62
Andrew Trick42b7a712012-01-17 06:55:03 +000063char MachineScheduler::ID = 0;
Andrew Trick96f678f2012-01-13 06:30:30 +000064
Andrew Trick42b7a712012-01-17 06:55:03 +000065char &llvm::MachineSchedulerID = MachineScheduler::ID;
Andrew Trick96f678f2012-01-13 06:30:30 +000066
Andrew Trick42b7a712012-01-17 06:55:03 +000067INITIALIZE_PASS_BEGIN(MachineScheduler, "misched",
Andrew Trick96f678f2012-01-13 06:30:30 +000068 "Machine Instruction Scheduler", false, false)
69INITIALIZE_AG_DEPENDENCY(AliasAnalysis)
70INITIALIZE_PASS_DEPENDENCY(SlotIndexes)
71INITIALIZE_PASS_DEPENDENCY(LiveIntervals)
Andrew Trick42b7a712012-01-17 06:55:03 +000072INITIALIZE_PASS_END(MachineScheduler, "misched",
Andrew Trick96f678f2012-01-13 06:30:30 +000073 "Machine Instruction Scheduler", false, false)
74
Andrew Trick42b7a712012-01-17 06:55:03 +000075MachineScheduler::MachineScheduler()
Andrew Trickc174eaf2012-03-08 01:41:12 +000076: MachineFunctionPass(ID) {
Andrew Trick42b7a712012-01-17 06:55:03 +000077 initializeMachineSchedulerPass(*PassRegistry::getPassRegistry());
Andrew Trick96f678f2012-01-13 06:30:30 +000078}
79
Andrew Trick42b7a712012-01-17 06:55:03 +000080void MachineScheduler::getAnalysisUsage(AnalysisUsage &AU) const {
Andrew Trick96f678f2012-01-13 06:30:30 +000081 AU.setPreservesCFG();
82 AU.addRequiredID(MachineDominatorsID);
83 AU.addRequired<MachineLoopInfo>();
84 AU.addRequired<AliasAnalysis>();
Andrew Trickd04ec0c2012-03-09 00:52:20 +000085 AU.addRequired<TargetPassConfig>();
Andrew Trick96f678f2012-01-13 06:30:30 +000086 AU.addRequired<SlotIndexes>();
87 AU.addPreserved<SlotIndexes>();
88 AU.addRequired<LiveIntervals>();
89 AU.addPreserved<LiveIntervals>();
Andrew Trick96f678f2012-01-13 06:30:30 +000090 MachineFunctionPass::getAnalysisUsage(AU);
91}
92
Andrew Trick96f678f2012-01-13 06:30:30 +000093MachinePassRegistry MachineSchedRegistry::Registry;
94
Andrew Trickd04ec0c2012-03-09 00:52:20 +000095/// A dummy default scheduler factory indicates whether the scheduler
96/// is overridden on the command line.
97static ScheduleDAGInstrs *useDefaultMachineSched(MachineSchedContext *C) {
98 return 0;
99}
Andrew Trick96f678f2012-01-13 06:30:30 +0000100
101/// MachineSchedOpt allows command line selection of the scheduler.
102static cl::opt<MachineSchedRegistry::ScheduleDAGCtor, false,
103 RegisterPassParser<MachineSchedRegistry> >
104MachineSchedOpt("misched",
Andrew Trickd04ec0c2012-03-09 00:52:20 +0000105 cl::init(&useDefaultMachineSched), cl::Hidden,
Andrew Trick96f678f2012-01-13 06:30:30 +0000106 cl::desc("Machine instruction scheduler to use"));
107
Andrew Trickd04ec0c2012-03-09 00:52:20 +0000108static MachineSchedRegistry
109SchedDefaultRegistry("default", "Use the target's default scheduler choice.",
110 useDefaultMachineSched);
111
112/// Forward declare the common machine scheduler. This will be used as the
113/// default scheduler if the target does not set a default.
114static ScheduleDAGInstrs *createCommonMachineSched(MachineSchedContext *C);
115
Andrew Trickcb058d52012-03-14 04:00:38 +0000116/// Top-level MachineScheduler pass driver.
117///
118/// Visit blocks in function order. Divide each block into scheduling regions
119/// and visit them bottom-up. This is consistent with the DAG builder, which
120/// traverses scheduling regions bottom-up, but not essential.
121///
122/// This design avoids exposing scheduling boundaries to the DAG builder,
123/// simplifying the DAG builder's support for "special" target instructions,
124/// while at the same time allowing target schedulers to operate across
125/// scheduling boundaries, for example to bundle the boudary instructions
126/// without reordering them. This creates complexity, because the target
127/// scheduler must update the RegionBegin and RegionEnd positions cached by
128/// ScheduleDAGInstrs whenever adding or removing instructions. A much simpler
129/// design would be to split blocks at scheduling boundaries, but LLVM has a
130/// general bias against block splitting purely for implementation simplicity.
Andrew Trick42b7a712012-01-17 06:55:03 +0000131bool MachineScheduler::runOnMachineFunction(MachineFunction &mf) {
Andrew Trick96f678f2012-01-13 06:30:30 +0000132 // Initialize the context of the pass.
133 MF = &mf;
134 MLI = &getAnalysis<MachineLoopInfo>();
135 MDT = &getAnalysis<MachineDominatorTree>();
Andrew Trickd04ec0c2012-03-09 00:52:20 +0000136 PassConfig = &getAnalysis<TargetPassConfig>();
Andrew Trickc174eaf2012-03-08 01:41:12 +0000137 AA = &getAnalysis<AliasAnalysis>();
138
Lang Hames907cc8f2012-01-27 22:36:19 +0000139 LIS = &getAnalysis<LiveIntervals>();
Andrew Trickc174eaf2012-03-08 01:41:12 +0000140 const TargetInstrInfo *TII = MF->getTarget().getInstrInfo();
Andrew Trick96f678f2012-01-13 06:30:30 +0000141
142 // Select the scheduler, or set the default.
Andrew Trickd04ec0c2012-03-09 00:52:20 +0000143 MachineSchedRegistry::ScheduleDAGCtor Ctor = MachineSchedOpt;
144 if (Ctor == useDefaultMachineSched) {
145 // Get the default scheduler set by the target.
146 Ctor = MachineSchedRegistry::getDefault();
147 if (!Ctor) {
148 Ctor = createCommonMachineSched;
149 MachineSchedRegistry::setDefault(Ctor);
150 }
Andrew Trick96f678f2012-01-13 06:30:30 +0000151 }
152 // Instantiate the selected scheduler.
153 OwningPtr<ScheduleDAGInstrs> Scheduler(Ctor(this));
154
155 // Visit all machine basic blocks.
156 for (MachineFunction::iterator MBB = MF->begin(), MBBEnd = MF->end();
157 MBB != MBBEnd; ++MBB) {
158
Andrew Trick1fabd9f2012-03-09 08:02:51 +0000159 Scheduler->startBlock(MBB);
160
Andrew Tricke9ef4ed2012-01-14 02:17:09 +0000161 // Break the block into scheduling regions [I, RegionEnd), and schedule each
Andrew Trickfe4d6df2012-03-09 22:34:56 +0000162 // region as soon as it is discovered. RegionEnd points the the scheduling
163 // boundary at the bottom of the region. The DAG does not include RegionEnd,
164 // but the region does (i.e. the next RegionEnd is above the previous
165 // RegionBegin). If the current block has no terminator then RegionEnd ==
166 // MBB->end() for the bottom region.
167 //
168 // The Scheduler may insert instructions during either schedule() or
169 // exitRegion(), even for empty regions. So the local iterators 'I' and
170 // 'RegionEnd' are invalid across these calls.
Andrew Tricke9ef4ed2012-01-14 02:17:09 +0000171 unsigned RemainingCount = MBB->size();
Andrew Trick7799eb42012-03-09 03:46:39 +0000172 for(MachineBasicBlock::iterator RegionEnd = MBB->end();
Andrew Trickfe4d6df2012-03-09 22:34:56 +0000173 RegionEnd != MBB->begin(); RegionEnd = Scheduler->begin()) {
Andrew Trick1fabd9f2012-03-09 08:02:51 +0000174 // Avoid decrementing RegionEnd for blocks with no terminator.
175 if (RegionEnd != MBB->end()
176 || TII->isSchedulingBoundary(llvm::prior(RegionEnd), MBB, *MF)) {
177 --RegionEnd;
178 // Count the boundary instruction.
179 --RemainingCount;
180 }
181
Andrew Tricke9ef4ed2012-01-14 02:17:09 +0000182 // The next region starts above the previous region. Look backward in the
183 // instruction stream until we find the nearest boundary.
184 MachineBasicBlock::iterator I = RegionEnd;
Andrew Trick7799eb42012-03-09 03:46:39 +0000185 for(;I != MBB->begin(); --I, --RemainingCount) {
Andrew Tricke9ef4ed2012-01-14 02:17:09 +0000186 if (TII->isSchedulingBoundary(llvm::prior(I), MBB, *MF))
187 break;
188 }
Andrew Trick47c14452012-03-07 05:21:52 +0000189 // Notify the scheduler of the region, even if we may skip scheduling
190 // it. Perhaps it still needs to be bundled.
191 Scheduler->enterRegion(MBB, I, RegionEnd, RemainingCount);
192
193 // Skip empty scheduling regions (0 or 1 schedulable instructions).
194 if (I == RegionEnd || I == llvm::prior(RegionEnd)) {
Andrew Trick47c14452012-03-07 05:21:52 +0000195 // Close the current region. Bundle the terminator if needed.
Andrew Trickfe4d6df2012-03-09 22:34:56 +0000196 // This invalidates 'RegionEnd' and 'I'.
Andrew Trick47c14452012-03-07 05:21:52 +0000197 Scheduler->exitRegion();
Andrew Trickc6cf11b2012-01-17 06:55:07 +0000198 continue;
Andrew Trick3c58ba82012-01-14 02:17:18 +0000199 }
Andrew Trickc6cf11b2012-01-17 06:55:07 +0000200 DEBUG(dbgs() << "MachineScheduling " << MF->getFunction()->getName()
Andrew Trick291411c2012-02-08 02:17:21 +0000201 << ":BB#" << MBB->getNumber() << "\n From: " << *I << " To: ";
202 if (RegionEnd != MBB->end()) dbgs() << *RegionEnd;
203 else dbgs() << "End";
204 dbgs() << " Remaining: " << RemainingCount << "\n");
Andrew Trickc6cf11b2012-01-17 06:55:07 +0000205
Andrew Trickd24da972012-03-09 03:46:42 +0000206 // Schedule a region: possibly reorder instructions.
Andrew Trickfe4d6df2012-03-09 22:34:56 +0000207 // This invalidates 'RegionEnd' and 'I'.
Andrew Trick953be892012-03-07 23:00:49 +0000208 Scheduler->schedule();
Andrew Trickd24da972012-03-09 03:46:42 +0000209
210 // Close the current region.
Andrew Trick47c14452012-03-07 05:21:52 +0000211 Scheduler->exitRegion();
212
213 // Scheduling has invalidated the current iterator 'I'. Ask the
214 // scheduler for the top of it's scheduled region.
215 RegionEnd = Scheduler->begin();
Andrew Tricke9ef4ed2012-01-14 02:17:09 +0000216 }
217 assert(RemainingCount == 0 && "Instruction count mismatch!");
Andrew Trick953be892012-03-07 23:00:49 +0000218 Scheduler->finishBlock();
Andrew Trick96f678f2012-01-13 06:30:30 +0000219 }
220 return true;
221}
222
Andrew Trick42b7a712012-01-17 06:55:03 +0000223void MachineScheduler::print(raw_ostream &O, const Module* m) const {
Andrew Trick96f678f2012-01-13 06:30:30 +0000224 // unimplemented
225}
226
Andrew Trick5edf2f02012-01-14 02:17:06 +0000227//===----------------------------------------------------------------------===//
Andrew Trickc174eaf2012-03-08 01:41:12 +0000228// ScheduleTopeDownLive - Base class for basic top-down scheduling with
229// LiveIntervals preservation.
230// ===----------------------------------------------------------------------===//
231
232namespace {
233/// ScheduleTopDownLive is an implementation of ScheduleDAGInstrs that schedules
234/// machine instructions while updating LiveIntervals.
235class ScheduleTopDownLive : public ScheduleDAGInstrs {
236 AliasAnalysis *AA;
237public:
238 ScheduleTopDownLive(MachineSchedContext *C):
239 ScheduleDAGInstrs(*C->MF, *C->MLI, *C->MDT, /*IsPostRA=*/false, C->LIS),
240 AA(C->AA) {}
241
242 /// ScheduleDAGInstrs interface.
243 void schedule();
244
245 /// Interface implemented by the selected top-down liveinterval scheduler.
246 ///
247 /// Pick the next node to schedule, or return NULL.
248 virtual SUnit *pickNode() = 0;
249
250 /// When all preceeding dependencies have been resolved, free this node for
251 /// scheduling.
252 virtual void releaseNode(SUnit *SU) = 0;
253
254protected:
255 void releaseSucc(SUnit *SU, SDep *SuccEdge);
256 void releaseSuccessors(SUnit *SU);
257};
258} // namespace
259
260/// ReleaseSucc - Decrement the NumPredsLeft count of a successor. When
261/// NumPredsLeft reaches zero, release the successor node.
262void ScheduleTopDownLive::releaseSucc(SUnit *SU, SDep *SuccEdge) {
263 SUnit *SuccSU = SuccEdge->getSUnit();
264
265#ifndef NDEBUG
266 if (SuccSU->NumPredsLeft == 0) {
267 dbgs() << "*** Scheduling failed! ***\n";
268 SuccSU->dump(this);
269 dbgs() << " has been released too many times!\n";
270 llvm_unreachable(0);
271 }
272#endif
273 --SuccSU->NumPredsLeft;
274 if (SuccSU->NumPredsLeft == 0 && SuccSU != &ExitSU)
275 releaseNode(SuccSU);
276}
277
278/// releaseSuccessors - Call releaseSucc on each of SU's successors.
279void ScheduleTopDownLive::releaseSuccessors(SUnit *SU) {
280 for (SUnit::succ_iterator I = SU->Succs.begin(), E = SU->Succs.end();
281 I != E; ++I) {
282 releaseSucc(SU, &*I);
283 }
284}
285
286/// schedule - This is called back from ScheduleDAGInstrs::Run() when it's
287/// time to do some work.
288void ScheduleTopDownLive::schedule() {
289 buildSchedGraph(AA);
290
291 DEBUG(dbgs() << "********** MI Scheduling **********\n");
292 DEBUG(for (unsigned su = 0, e = SUnits.size(); su != e; ++su)
293 SUnits[su].dumpAll(this));
294
295 if (ViewMISchedDAGs) viewGraph();
296
297 // Release any successors of the special Entry node. It is currently unused,
298 // but we keep up appearances.
299 releaseSuccessors(&EntrySU);
300
301 // Release all DAG roots for scheduling.
302 for (std::vector<SUnit>::iterator I = SUnits.begin(), E = SUnits.end();
303 I != E; ++I) {
304 // A SUnit is ready to schedule if it has no predecessors.
305 if (I->Preds.empty())
306 releaseNode(&(*I));
307 }
308
Andrew Trick68675c62012-03-09 04:29:02 +0000309 MachineBasicBlock::iterator InsertPos = RegionBegin;
Andrew Trickc174eaf2012-03-08 01:41:12 +0000310 while (SUnit *SU = pickNode()) {
311 DEBUG(dbgs() << "*** Scheduling Instruction:\n"; SU->dump(this));
312
313 // Move the instruction to its new location in the instruction stream.
314 MachineInstr *MI = SU->getInstr();
315 if (&*InsertPos == MI)
316 ++InsertPos;
317 else {
318 BB->splice(InsertPos, BB, MI);
319 LIS->handleMove(MI);
Andrew Trick68675c62012-03-09 04:29:02 +0000320 if (RegionBegin == InsertPos)
321 RegionBegin = MI;
Andrew Trickc174eaf2012-03-08 01:41:12 +0000322 }
323
324 // Release dependent instructions for scheduling.
325 releaseSuccessors(SU);
326 }
327}
328
329//===----------------------------------------------------------------------===//
330// Placeholder for the default machine instruction scheduler.
Andrew Trick42b7a712012-01-17 06:55:03 +0000331//===----------------------------------------------------------------------===//
332
333namespace {
Andrew Trickd04ec0c2012-03-09 00:52:20 +0000334class CommonMachineScheduler : public ScheduleDAGInstrs {
Andrew Trickc174eaf2012-03-08 01:41:12 +0000335 AliasAnalysis *AA;
Andrew Trick42b7a712012-01-17 06:55:03 +0000336public:
Andrew Trickd04ec0c2012-03-09 00:52:20 +0000337 CommonMachineScheduler(MachineSchedContext *C):
Andrew Trickc174eaf2012-03-08 01:41:12 +0000338 ScheduleDAGInstrs(*C->MF, *C->MLI, *C->MDT, /*IsPostRA=*/false, C->LIS),
339 AA(C->AA) {}
Andrew Trick42b7a712012-01-17 06:55:03 +0000340
Andrew Trick953be892012-03-07 23:00:49 +0000341 /// schedule - This is called back from ScheduleDAGInstrs::Run() when it's
Andrew Trickc6cf11b2012-01-17 06:55:07 +0000342 /// time to do some work.
Andrew Trick953be892012-03-07 23:00:49 +0000343 void schedule();
Andrew Trick42b7a712012-01-17 06:55:03 +0000344};
345} // namespace
346
Andrew Trickd04ec0c2012-03-09 00:52:20 +0000347/// The common machine scheduler will be used as the default scheduler if the
348/// target does not set a default.
349static ScheduleDAGInstrs *createCommonMachineSched(MachineSchedContext *C) {
350 return new CommonMachineScheduler(C);
Andrew Trick42b7a712012-01-17 06:55:03 +0000351}
352static MachineSchedRegistry
Andrew Trickd04ec0c2012-03-09 00:52:20 +0000353SchedCommonRegistry("common", "Use the target's default scheduler choice.",
354 createCommonMachineSched);
Andrew Trick42b7a712012-01-17 06:55:03 +0000355
Andrew Trick42b7a712012-01-17 06:55:03 +0000356/// Schedule - This is called back from ScheduleDAGInstrs::Run() when it's
357/// time to do some work.
Andrew Trickd04ec0c2012-03-09 00:52:20 +0000358void CommonMachineScheduler::schedule() {
Andrew Trickc174eaf2012-03-08 01:41:12 +0000359 buildSchedGraph(AA);
Andrew Trick42b7a712012-01-17 06:55:03 +0000360
361 DEBUG(dbgs() << "********** MI Scheduling **********\n");
362 DEBUG(for (unsigned su = 0, e = SUnits.size(); su != e; ++su)
363 SUnits[su].dumpAll(this));
364
365 // TODO: Put interesting things here.
Andrew Trickc6cf11b2012-01-17 06:55:07 +0000366 //
367 // When this is fully implemented, it will become a subclass of
368 // ScheduleTopDownLive. So this driver will disappear.
Andrew Trick42b7a712012-01-17 06:55:03 +0000369}
370
371//===----------------------------------------------------------------------===//
Andrew Trick5edf2f02012-01-14 02:17:06 +0000372// Machine Instruction Shuffler for Correctness Testing
373//===----------------------------------------------------------------------===//
374
Andrew Trick96f678f2012-01-13 06:30:30 +0000375#ifndef NDEBUG
376namespace {
Andrew Trickb4566a92012-02-22 06:08:11 +0000377// Nodes with a higher number have higher priority. This way we attempt to
Andrew Trickc6cf11b2012-01-17 06:55:07 +0000378// schedule the latest instructions earliest.
379//
380// TODO: Relies on the property of the BuildSchedGraph that results in SUnits
Andrew Trickb4566a92012-02-22 06:08:11 +0000381// being ordered in sequence top-down.
Andrew Trickc6cf11b2012-01-17 06:55:07 +0000382struct ShuffleSUnitOrder {
383 bool operator()(SUnit *A, SUnit *B) const {
Andrew Trickb4566a92012-02-22 06:08:11 +0000384 return A->NodeNum < B->NodeNum;
Andrew Trickc6cf11b2012-01-17 06:55:07 +0000385 }
386};
387
Andrew Trick96f678f2012-01-13 06:30:30 +0000388/// Reorder instructions as much as possible.
Andrew Trick42b7a712012-01-17 06:55:03 +0000389class InstructionShuffler : public ScheduleTopDownLive {
Andrew Trickc6cf11b2012-01-17 06:55:07 +0000390 std::priority_queue<SUnit*, std::vector<SUnit*>, ShuffleSUnitOrder> Queue;
Andrew Trick96f678f2012-01-13 06:30:30 +0000391public:
Andrew Trickc174eaf2012-03-08 01:41:12 +0000392 InstructionShuffler(MachineSchedContext *C):
393 ScheduleTopDownLive(C) {}
Andrew Trick96f678f2012-01-13 06:30:30 +0000394
Andrew Trickc6cf11b2012-01-17 06:55:07 +0000395 /// ScheduleTopDownLive Interface
396
397 virtual SUnit *pickNode() {
398 if (Queue.empty()) return NULL;
399 SUnit *SU = Queue.top();
400 Queue.pop();
401 return SU;
402 }
403
404 virtual void releaseNode(SUnit *SU) {
405 Queue.push(SU);
Andrew Trick96f678f2012-01-13 06:30:30 +0000406 }
407};
408} // namespace
409
Andrew Trickc174eaf2012-03-08 01:41:12 +0000410static ScheduleDAGInstrs *createInstructionShuffler(MachineSchedContext *C) {
411 return new InstructionShuffler(C);
Andrew Trick96f678f2012-01-13 06:30:30 +0000412}
413static MachineSchedRegistry ShufflerRegistry("shuffle",
414 "Shuffle machine instructions",
415 createInstructionShuffler);
416#endif // !NDEBUG