LLVM
23.0.0git
lib
Target
RISCV
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
"
17
#include "
RISCVVSETVLIInfoAnalysis.h
"
18
#include "
llvm/CodeGen/MachineScheduler.h
"
19
20
namespace
llvm
{
21
22
/// A GenericScheduler implementation for RISCV pre RA scheduling.
23
class
RISCVPreRAMachineSchedStrategy
:
public
GenericScheduler
{
24
const
RISCVSubtarget
*ST;
25
RISCV::RISCVVSETVLIInfoAnalysis
VIA;
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
35
public
:
36
RISCVPreRAMachineSchedStrategy
(
const
MachineSchedContext
*
C
)
37
:
GenericScheduler
(
C
), ST(&
C
->MF->getSubtarget<
RISCVSubtarget
>()),
38
VIA(ST,
C
->LIS) {}
39
40
protected
:
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
MBB
MachineBasicBlock & MBB
Definition
ARMSLSHardening.cpp:71
MI
IRTranslator LLVM IR MI
Definition
IRTranslator.cpp:110
MachineScheduler.h
RISCVSubtarget.h
RISCVVSETVLIInfoAnalysis.h
llvm::GenericSchedulerBase::CandReason
CandReason
Represent the type of SchedCandidate found within a single queue.
Definition
MachineScheduler.h:1094
llvm::GenericScheduler::GenericScheduler
GenericScheduler(const MachineSchedContext *C)
Definition
MachineScheduler.h:1257
llvm::MachineBasicBlock
Definition
MachineBasicBlock.h:122
llvm::MachineInstr
Representation of each machine instruction.
Definition
MachineInstr.h:72
llvm::RISCVPreRAMachineSchedStrategy::schedNode
void schedNode(SUnit *SU, bool IsTopNode) override
Update the scheduler's state after scheduling a node.
Definition
RISCVMachineScheduler.cpp:195
llvm::RISCVPreRAMachineSchedStrategy::leaveMBB
void leaveMBB() override
Tell the strategy that current MBB is done.
Definition
RISCVMachineScheduler.cpp:190
llvm::RISCVPreRAMachineSchedStrategy::RISCVPreRAMachineSchedStrategy
RISCVPreRAMachineSchedStrategy(const MachineSchedContext *C)
Definition
RISCVMachineScheduler.h:36
llvm::RISCVPreRAMachineSchedStrategy::tryCandidate
bool tryCandidate(SchedCandidate &Cand, SchedCandidate &TryCand, SchedBoundary *Zone) const override
Apply a set of heuristics to a new candidate.
Definition
RISCVMachineScheduler.cpp:62
llvm::RISCVPreRAMachineSchedStrategy::enterMBB
void enterMBB(MachineBasicBlock *MBB) override
Tell the strategy that MBB is about to be processed.
Definition
RISCVMachineScheduler.cpp:185
llvm::RISCVSubtarget
Definition
RISCVSubtarget.h:79
llvm::RISCV::RISCVVSETVLIInfoAnalysis
Definition
RISCVVSETVLIInfoAnalysis.h:571
llvm::RISCV::VSETVLIInfo
Defines the abstract state with which the forward dataflow models the values of the VL and VTYPE regi...
Definition
RISCVVSETVLIInfoAnalysis.h:171
llvm::SUnit
Scheduling unit. This is a node in the scheduling DAG.
Definition
ScheduleDAG.h:249
llvm::SchedBoundary
Each Scheduling boundary is associated with ready queues.
Definition
MachineScheduler.h:856
llvm::CallingConv::C
@ C
The default llvm calling convention, compatible with C.
Definition
CallingConv.h:34
llvm
This is an optimization pass for GlobalISel generic memory operations.
Definition
Types.h:26
llvm::GenericSchedulerBase::SchedCandidate
Store the state used by GenericScheduler heuristics, required for the lifetime of one invocation of p...
Definition
MachineScheduler.h:1157
llvm::MachineSchedContext
MachineSchedContext provides enough context from the MachineScheduler pass for the target to instanti...
Definition
MachineScheduler.h:143
Generated on
for LLVM by
1.14.0