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 "llvm/CodeGen/Passes.h"
23 #include "llvm/CodeGen/MachineFunctionPass.h"
24 #include "llvm/Support/Compiler.h"
25 #include "llvm/Support/Debug.h"
29 class VISIBILITY_HIDDEN SchedulePostRATDList : public MachineFunctionPass {
32 SchedulePostRATDList() : MachineFunctionPass((intptr_t)&ID) {}
35 const TargetMachine *TM;
37 const char *getPassName() const {
38 return "Post RA top-down list latency scheduler (STUB)";
41 bool runOnMachineFunction(MachineFunction &Fn);
43 char SchedulePostRATDList::ID = 0;
46 bool SchedulePostRATDList::runOnMachineFunction(MachineFunction &Fn) {
47 DOUT << "SchedulePostRATDList\n";
49 TM = &MF->getTarget();
51 // Loop over all of the basic blocks
52 for (MachineFunction::iterator MBB = Fn.begin(), MBBe = Fn.end();
60 //===----------------------------------------------------------------------===//
61 // Public Constructor Functions
62 //===----------------------------------------------------------------------===//
64 FunctionPass *llvm::createPostRAScheduler() {
65 return new SchedulePostRATDList();