blob: 93532d9545a6e57f59f4bc810ec8562dcc953488 [file] [log] [blame]
QingShan Zhang5321dcd2019-03-27 03:50:16 +00001//===- 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
13#ifndef LLVM_LIB_TARGET_POWERPC_POWERPCMACHINESCHEDULER_H
14#define LLVM_LIB_TARGET_POWERPC_POWERPCMACHINESCHEDULER_H
15
16#include "llvm/CodeGen/MachineScheduler.h"
17
18namespace llvm {
19
20/// A MachineSchedStrategy implementation for PowerPC pre RA scheduling.
21class PPCPreRASchedStrategy : public GenericScheduler {
22public:
23 PPCPreRASchedStrategy(const MachineSchedContext *C) :
24 GenericScheduler(C) {}
QingShan Zhang449bfdd2019-05-24 05:30:09 +000025protected:
26 void tryCandidate(SchedCandidate &Cand, SchedCandidate &TryCand,
27 SchedBoundary *Zone) const override;
28private:
29 bool biasAddiLoadCandidate(SchedCandidate &Cand,
30 SchedCandidate &TryCand,
31 SchedBoundary &Zone) const;
QingShan Zhang5321dcd2019-03-27 03:50:16 +000032};
33
34/// A MachineSchedStrategy implementation for PowerPC post RA scheduling.
35class PPCPostRASchedStrategy : public PostGenericScheduler {
36public:
37 PPCPostRASchedStrategy(const MachineSchedContext *C) :
38 PostGenericScheduler(C) {}
39
40protected:
41 void initialize(ScheduleDAGMI *Dag) override;
42 SUnit *pickNode(bool &IsTopNode) override;
43 void enterMBB(MachineBasicBlock *MBB) override;
44 void leaveMBB() override;
45};
46
47} // end namespace llvm
48
49#endif // LLVM_LIB_TARGET_POWERPC_POWERPCMACHINESCHEDULER_H