LLVM 23.0.0git
RISCVMachineScheduler.h
Go to the documentation of this file.
1//===--- RISCVMachineScheduler.h - Custom RISC-V 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 RISC-V MI scheduler.
10//
11//===----------------------------------------------------------------------===//
12
13#ifndef LLVM_LIB_TARGET_RISCV_RISCVMACHINESCHEDULER_H
14#define LLVM_LIB_TARGET_RISCV_RISCVMACHINESCHEDULER_H
15
16#include "RISCVSubtarget.h"
19
20namespace llvm {
21
22/// A GenericScheduler implementation for RISCV pre RA scheduling.
24 const RISCVSubtarget *ST;
26 RISCV::VSETVLIInfo TopInfo;
27 RISCV::VSETVLIInfo BottomInfo;
28
29 RISCV::VSETVLIInfo getVSETVLIInfo(const MachineInstr *MI) const;
30 bool tryVSETVLIInfo(const RISCV::VSETVLIInfo &TryInfo,
31 const RISCV::VSETVLIInfo &CandInfo,
32 SchedCandidate &TryCand, SchedCandidate &Cand,
33 CandReason Reason) const;
34
35public:
37 : GenericScheduler(C), ST(&C->MF->getSubtarget<RISCVSubtarget>()),
38 VIA(ST, C->LIS) {}
39
40protected:
41 bool tryCandidate(SchedCandidate &Cand, SchedCandidate &TryCand,
42 SchedBoundary *Zone) const override;
43 void enterMBB(MachineBasicBlock *MBB) override;
44 void leaveMBB() override;
45 void schedNode(SUnit *SU, bool IsTopNode) override;
46};
47
48} // end namespace llvm
49
50#endif
MachineBasicBlock & MBB
IRTranslator LLVM IR MI
CandReason
Represent the type of SchedCandidate found within a single queue.
GenericScheduler(const MachineSchedContext *C)
Representation of each machine instruction.
void schedNode(SUnit *SU, bool IsTopNode) override
Update the scheduler's state after scheduling a node.
void leaveMBB() override
Tell the strategy that current MBB is done.
RISCVPreRAMachineSchedStrategy(const MachineSchedContext *C)
bool tryCandidate(SchedCandidate &Cand, SchedCandidate &TryCand, SchedBoundary *Zone) const override
Apply a set of heuristics to a new candidate.
void enterMBB(MachineBasicBlock *MBB) override
Tell the strategy that MBB is about to be processed.
Defines the abstract state with which the forward dataflow models the values of the VL and VTYPE regi...
Scheduling unit. This is a node in the scheduling DAG.
Each Scheduling boundary is associated with ready queues.
@ C
The default llvm calling convention, compatible with C.
Definition CallingConv.h:34
This is an optimization pass for GlobalISel generic memory operations.
Definition Types.h:26
Store the state used by GenericScheduler heuristics, required for the lifetime of one invocation of p...
MachineSchedContext provides enough context from the MachineScheduler pass for the target to instanti...