xref: /freebsd/contrib/llvm-project/llvm/lib/Target/RISCV/RISCV.h (revision 66fd12cf4896eb08ad8e7a2627537f84ead84dd3)
1 //===-- RISCV.h - Top-level interface for RISCV -----------------*- 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 AsmPrinter;
22 class FunctionPass;
23 class InstructionSelector;
24 class MCInst;
25 class MCOperand;
26 class MachineInstr;
27 class MachineOperand;
28 class PassRegistry;
29 class RISCVRegisterBankInfo;
30 class RISCVSubtarget;
31 class RISCVTargetMachine;
32 
33 FunctionPass *createRISCVCodeGenPreparePass();
34 void initializeRISCVCodeGenPreparePass(PassRegistry &);
35 
36 bool lowerRISCVMachineInstrToMCInst(const MachineInstr *MI, MCInst &OutMI,
37                                     AsmPrinter &AP);
38 bool lowerRISCVMachineOperandToMCOperand(const MachineOperand &MO,
39                                          MCOperand &MCOp, const AsmPrinter &AP);
40 
41 FunctionPass *createRISCVISelDag(RISCVTargetMachine &TM,
42                                  CodeGenOpt::Level OptLevel);
43 
44 FunctionPass *createRISCVMakeCompressibleOptPass();
45 void initializeRISCVMakeCompressibleOptPass(PassRegistry &);
46 
47 FunctionPass *createRISCVGatherScatterLoweringPass();
48 void initializeRISCVGatherScatterLoweringPass(PassRegistry &);
49 
50 FunctionPass *createRISCVSExtWRemovalPass();
51 void initializeRISCVSExtWRemovalPass(PassRegistry &);
52 
53 FunctionPass *createRISCVStripWSuffixPass();
54 void initializeRISCVStripWSuffixPass(PassRegistry &);
55 
56 FunctionPass *createRISCVMergeBaseOffsetOptPass();
57 void initializeRISCVMergeBaseOffsetOptPass(PassRegistry &);
58 
59 FunctionPass *createRISCVExpandPseudoPass();
60 void initializeRISCVExpandPseudoPass(PassRegistry &);
61 
62 FunctionPass *createRISCVPreRAExpandPseudoPass();
63 void initializeRISCVPreRAExpandPseudoPass(PassRegistry &);
64 
65 FunctionPass *createRISCVExpandAtomicPseudoPass();
66 void initializeRISCVExpandAtomicPseudoPass(PassRegistry &);
67 
68 FunctionPass *createRISCVInsertVSETVLIPass();
69 void initializeRISCVInsertVSETVLIPass(PassRegistry &);
70 
71 FunctionPass *createRISCVRedundantCopyEliminationPass();
72 void initializeRISCVRedundantCopyEliminationPass(PassRegistry &);
73 
74 InstructionSelector *createRISCVInstructionSelector(const RISCVTargetMachine &,
75                                                     RISCVSubtarget &,
76                                                     RISCVRegisterBankInfo &);
77 void initializeRISCVDAGToDAGISelPass(PassRegistry &);
78 } // namespace llvm
79 
80 #endif
81