10b57cec5SDimitry Andric //===- PPCMachineScheduler.h - Custom PowerPC MI scheduler --*- C++ -*-===// 20b57cec5SDimitry Andric // 30b57cec5SDimitry Andric // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. 40b57cec5SDimitry Andric // See https://llvm.org/LICENSE.txt for license information. 50b57cec5SDimitry Andric // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 60b57cec5SDimitry Andric // 70b57cec5SDimitry Andric //===----------------------------------------------------------------------===// 80b57cec5SDimitry Andric // 90b57cec5SDimitry Andric // Custom PowerPC MI scheduler. 100b57cec5SDimitry Andric // 110b57cec5SDimitry Andric //===----------------------------------------------------------------------===// 120b57cec5SDimitry Andric 130b57cec5SDimitry Andric #ifndef LLVM_LIB_TARGET_POWERPC_POWERPCMACHINESCHEDULER_H 140b57cec5SDimitry Andric #define LLVM_LIB_TARGET_POWERPC_POWERPCMACHINESCHEDULER_H 150b57cec5SDimitry Andric 160b57cec5SDimitry Andric #include "llvm/CodeGen/MachineScheduler.h" 170b57cec5SDimitry Andric 180b57cec5SDimitry Andric namespace llvm { 190b57cec5SDimitry Andric 200b57cec5SDimitry Andric /// A MachineSchedStrategy implementation for PowerPC pre RA scheduling. 210b57cec5SDimitry Andric class PPCPreRASchedStrategy : public GenericScheduler { 220b57cec5SDimitry Andric public: 230b57cec5SDimitry Andric PPCPreRASchedStrategy(const MachineSchedContext *C) : 240b57cec5SDimitry Andric GenericScheduler(C) {} 250b57cec5SDimitry Andric protected: 260b57cec5SDimitry Andric void tryCandidate(SchedCandidate &Cand, SchedCandidate &TryCand, 270b57cec5SDimitry Andric SchedBoundary *Zone) const override; 280b57cec5SDimitry Andric private: 290b57cec5SDimitry Andric bool biasAddiLoadCandidate(SchedCandidate &Cand, 300b57cec5SDimitry Andric SchedCandidate &TryCand, 310b57cec5SDimitry Andric SchedBoundary &Zone) const; 320b57cec5SDimitry Andric }; 330b57cec5SDimitry Andric 340b57cec5SDimitry Andric /// A MachineSchedStrategy implementation for PowerPC post RA scheduling. 350b57cec5SDimitry Andric class PPCPostRASchedStrategy : public PostGenericScheduler { 360b57cec5SDimitry Andric public: 370b57cec5SDimitry Andric PPCPostRASchedStrategy(const MachineSchedContext *C) : 380b57cec5SDimitry Andric PostGenericScheduler(C) {} 390b57cec5SDimitry Andric 400b57cec5SDimitry Andric protected: 410b57cec5SDimitry Andric void initialize(ScheduleDAGMI *Dag) override; 420b57cec5SDimitry Andric SUnit *pickNode(bool &IsTopNode) override; 430b57cec5SDimitry Andric void enterMBB(MachineBasicBlock *MBB) override; 440b57cec5SDimitry Andric void leaveMBB() override; 45*5ffd83dbSDimitry Andric 46*5ffd83dbSDimitry Andric void tryCandidate(SchedCandidate &Cand, SchedCandidate &TryCand) override; 47*5ffd83dbSDimitry Andric bool biasAddiCandidate(SchedCandidate &Cand, SchedCandidate &TryCand) const; 480b57cec5SDimitry Andric }; 490b57cec5SDimitry Andric 500b57cec5SDimitry Andric } // end namespace llvm 510b57cec5SDimitry Andric 520b57cec5SDimitry Andric #endif // LLVM_LIB_TARGET_POWERPC_POWERPCMACHINESCHEDULER_H 53