PPCMachineScheduler.h 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. //===- PPCMachineScheduler.h - Custom PowerPC MI scheduler --*- C++ -*-===//
  2. //
  3. // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
  4. // See https://llvm.org/LICENSE.txt for license information.
  5. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
  6. //
  7. //===----------------------------------------------------------------------===//
  8. //
  9. // Custom PowerPC MI scheduler.
  10. //
  11. //===----------------------------------------------------------------------===//
  12. #ifndef LLVM_LIB_TARGET_POWERPC_POWERPCMACHINESCHEDULER_H
  13. #define LLVM_LIB_TARGET_POWERPC_POWERPCMACHINESCHEDULER_H
  14. #include "llvm/CodeGen/MachineScheduler.h"
  15. namespace llvm {
  16. /// A MachineSchedStrategy implementation for PowerPC pre RA scheduling.
  17. class PPCPreRASchedStrategy : public GenericScheduler {
  18. public:
  19. PPCPreRASchedStrategy(const MachineSchedContext *C) :
  20. GenericScheduler(C) {}
  21. protected:
  22. bool tryCandidate(SchedCandidate &Cand, SchedCandidate &TryCand,
  23. SchedBoundary *Zone) const override;
  24. private:
  25. bool biasAddiLoadCandidate(SchedCandidate &Cand,
  26. SchedCandidate &TryCand,
  27. SchedBoundary &Zone) const;
  28. };
  29. /// A MachineSchedStrategy implementation for PowerPC post RA scheduling.
  30. class PPCPostRASchedStrategy : public PostGenericScheduler {
  31. public:
  32. PPCPostRASchedStrategy(const MachineSchedContext *C) :
  33. PostGenericScheduler(C) {}
  34. protected:
  35. void initialize(ScheduleDAGMI *Dag) override;
  36. SUnit *pickNode(bool &IsTopNode) override;
  37. void enterMBB(MachineBasicBlock *MBB) override;
  38. void leaveMBB() override;
  39. bool tryCandidate(SchedCandidate &Cand, SchedCandidate &TryCand) override;
  40. bool biasAddiCandidate(SchedCandidate &Cand, SchedCandidate &TryCand) const;
  41. };
  42. } // end namespace llvm
  43. #endif // LLVM_LIB_TARGET_POWERPC_POWERPCMACHINESCHEDULER_H