1//===-- RISCV.h - Top-level interface for RISC-V ----------------*- 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// This file contains the entry points for global functions defined in the LLVM
10// RISC-V back-end.
11//
12//===----------------------------------------------------------------------===//
13
14#ifndef LLVM_LIB_TARGET_RISCV_RISCV_H
15#define LLVM_LIB_TARGET_RISCV_RISCV_H
16
17#include "MCTargetDesc/RISCVBaseInfo.h"
18#include "llvm/Target/TargetMachine.h"
19
20namespace llvm {
21class FunctionPass;
22class InstructionSelector;
23class PassRegistry;
24class RISCVRegisterBankInfo;
25class RISCVSubtarget;
26class RISCVTargetMachine;
27
28FunctionPass *createRISCVCodeGenPreparePass();
29void initializeRISCVCodeGenPreparePass(PassRegistry &);
30
31FunctionPass *createRISCVDeadRegisterDefinitionsPass();
32void initializeRISCVDeadRegisterDefinitionsPass(PassRegistry &);
33
34FunctionPass *createRISCVISelDag(RISCVTargetMachine &TM,
35 CodeGenOptLevel OptLevel);
36
37FunctionPass *createRISCVMakeCompressibleOptPass();
38void initializeRISCVMakeCompressibleOptPass(PassRegistry &);
39
40FunctionPass *createRISCVGatherScatterLoweringPass();
41void initializeRISCVGatherScatterLoweringPass(PassRegistry &);
42
43FunctionPass *createRISCVVectorPeepholePass();
44void initializeRISCVVectorPeepholePass(PassRegistry &);
45
46FunctionPass *createRISCVOptWInstrsPass();
47void initializeRISCVOptWInstrsPass(PassRegistry &);
48
49FunctionPass *createRISCVMergeBaseOffsetOptPass();
50void initializeRISCVMergeBaseOffsetOptPass(PassRegistry &);
51
52FunctionPass *createRISCVExpandPseudoPass();
53void initializeRISCVExpandPseudoPass(PassRegistry &);
54
55FunctionPass *createRISCVPreRAExpandPseudoPass();
56void initializeRISCVPreRAExpandPseudoPass(PassRegistry &);
57
58FunctionPass *createRISCVExpandAtomicPseudoPass();
59void initializeRISCVExpandAtomicPseudoPass(PassRegistry &);
60
61FunctionPass *createRISCVInsertVSETVLIPass();
62void initializeRISCVInsertVSETVLIPass(PassRegistry &);
63extern char &RISCVInsertVSETVLIID;
64
65FunctionPass *createRISCVPostRAExpandPseudoPass();
66void initializeRISCVPostRAExpandPseudoPass(PassRegistry &);
67FunctionPass *createRISCVInsertReadWriteCSRPass();
68void initializeRISCVInsertReadWriteCSRPass(PassRegistry &);
69
70FunctionPass *createRISCVInsertWriteVXRMPass();
71void initializeRISCVInsertWriteVXRMPass(PassRegistry &);
72
73FunctionPass *createRISCVRedundantCopyEliminationPass();
74void initializeRISCVRedundantCopyEliminationPass(PassRegistry &);
75
76FunctionPass *createRISCVMoveMergePass();
77void initializeRISCVMoveMergePass(PassRegistry &);
78
79FunctionPass *createRISCVPushPopOptimizationPass();
80void initializeRISCVPushPopOptPass(PassRegistry &);
81
82InstructionSelector *
83createRISCVInstructionSelector(const RISCVTargetMachine &,
84 const RISCVSubtarget &,
85 const RISCVRegisterBankInfo &);
86void initializeRISCVDAGToDAGISelLegacyPass(PassRegistry &);
87
88FunctionPass *createRISCVPostLegalizerCombiner();
89void initializeRISCVPostLegalizerCombinerPass(PassRegistry &);
90
91FunctionPass *createRISCVO0PreLegalizerCombiner();
92void initializeRISCVO0PreLegalizerCombinerPass(PassRegistry &);
93
94FunctionPass *createRISCVPreLegalizerCombiner();
95void initializeRISCVPreLegalizerCombinerPass(PassRegistry &);
96} // namespace llvm
97
98#endif
99