PostRASchedulerList.cpp 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. //===----- SchedulePostRAList.cpp - list 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. // 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.
  14. //
  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.
  18. //
  19. //===----------------------------------------------------------------------===//
  20. #define DEBUG_TYPE "post-RA-sched"
  21. #include "llvm/CodeGen/Passes.h"
  22. #include "llvm/CodeGen/MachineFunctionPass.h"
  23. #include "llvm/Support/Compiler.h"
  24. #include "llvm/Support/Debug.h"
  25. using namespace llvm;
  26. namespace {
  27. class VISIBILITY_HIDDEN SchedulePostRATDList : public MachineFunctionPass {
  28. public:
  29. static char ID;
  30. SchedulePostRATDList() : MachineFunctionPass(&ID) {}
  31. private:
  32. MachineFunction *MF;
  33. const TargetMachine *TM;
  34. public:
  35. const char *getPassName() const {
  36. return "Post RA top-down list latency scheduler (STUB)";
  37. }
  38. bool runOnMachineFunction(MachineFunction &Fn);
  39. };
  40. char SchedulePostRATDList::ID = 0;
  41. }
  42. bool SchedulePostRATDList::runOnMachineFunction(MachineFunction &Fn) {
  43. DOUT << "SchedulePostRATDList\n";
  44. MF = &Fn;
  45. TM = &MF->getTarget();
  46. // Loop over all of the basic blocks
  47. for (MachineFunction::iterator MBB = Fn.begin(), MBBe = Fn.end();
  48. MBB != MBBe; ++MBB)
  49. ;
  50. return true;
  51. }
  52. //===----------------------------------------------------------------------===//
  53. // Public Constructor Functions
  54. //===----------------------------------------------------------------------===//
  55. FunctionPass *llvm::createPostRAScheduler() {
  56. return new SchedulePostRATDList();
  57. }