xref: /freebsd/contrib/llvm-project/llvm/lib/Target/RISCV/RISCV.h (revision 5f757f3ff9144b609b3c433dfd370cc6bdc191ad)
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 
20 namespace llvm {
21 class FunctionPass;
22 class InstructionSelector;
23 class PassRegistry;
24 class RISCVRegisterBankInfo;
25 class RISCVSubtarget;
26 class RISCVTargetMachine;
27 
28 FunctionPass *createRISCVCodeGenPreparePass();
29 void initializeRISCVCodeGenPreparePass(PassRegistry &);
30 
31 FunctionPass *createRISCVDeadRegisterDefinitionsPass();
32 void initializeRISCVDeadRegisterDefinitionsPass(PassRegistry &);
33 
34 FunctionPass *createRISCVISelDag(RISCVTargetMachine &TM,
35                                  CodeGenOptLevel OptLevel);
36 
37 FunctionPass *createRISCVMakeCompressibleOptPass();
38 void initializeRISCVMakeCompressibleOptPass(PassRegistry &);
39 
40 FunctionPass *createRISCVGatherScatterLoweringPass();
41 void initializeRISCVGatherScatterLoweringPass(PassRegistry &);
42 
43 FunctionPass *createRISCVFoldMasksPass();
44 void initializeRISCVFoldMasksPass(PassRegistry &);
45 
46 FunctionPass *createRISCVOptWInstrsPass();
47 void initializeRISCVOptWInstrsPass(PassRegistry &);
48 
49 FunctionPass *createRISCVMergeBaseOffsetOptPass();
50 void initializeRISCVMergeBaseOffsetOptPass(PassRegistry &);
51 
52 FunctionPass *createRISCVExpandPseudoPass();
53 void initializeRISCVExpandPseudoPass(PassRegistry &);
54 
55 FunctionPass *createRISCVPreRAExpandPseudoPass();
56 void initializeRISCVPreRAExpandPseudoPass(PassRegistry &);
57 
58 FunctionPass *createRISCVExpandAtomicPseudoPass();
59 void initializeRISCVExpandAtomicPseudoPass(PassRegistry &);
60 
61 FunctionPass *createRISCVInsertVSETVLIPass();
62 void initializeRISCVInsertVSETVLIPass(PassRegistry &);
63 
64 FunctionPass *createRISCVPostRAExpandPseudoPass();
65 void initializeRISCVPostRAExpandPseudoPass(PassRegistry &);
66 FunctionPass *createRISCVInsertReadWriteCSRPass();
67 void initializeRISCVInsertReadWriteCSRPass(PassRegistry &);
68 
69 FunctionPass *createRISCVInsertWriteVXRMPass();
70 void initializeRISCVInsertWriteVXRMPass(PassRegistry &);
71 
72 FunctionPass *createRISCVRedundantCopyEliminationPass();
73 void initializeRISCVRedundantCopyEliminationPass(PassRegistry &);
74 
75 FunctionPass *createRISCVInitUndefPass();
76 void initializeRISCVInitUndefPass(PassRegistry &);
77 extern char &RISCVInitUndefID;
78 
79 FunctionPass *createRISCVMoveMergePass();
80 void initializeRISCVMoveMergePass(PassRegistry &);
81 
82 FunctionPass *createRISCVPushPopOptimizationPass();
83 void initializeRISCVPushPopOptPass(PassRegistry &);
84 
85 InstructionSelector *createRISCVInstructionSelector(const RISCVTargetMachine &,
86                                                     RISCVSubtarget &,
87                                                     RISCVRegisterBankInfo &);
88 void initializeRISCVDAGToDAGISelPass(PassRegistry &);
89 
90 FunctionPass *createRISCVPostLegalizerCombiner();
91 void initializeRISCVPostLegalizerCombinerPass(PassRegistry &);
92 
93 FunctionPass *createRISCVO0PreLegalizerCombiner();
94 void initializeRISCVO0PreLegalizerCombinerPass(PassRegistry &);
95 
96 FunctionPass *createRISCVPreLegalizerCombiner();
97 void initializeRISCVPreLegalizerCombinerPass(PassRegistry &);
98 } // namespace llvm
99 
100 #endif
101