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 RISCVRegisterBankInfo;
22 class RISCVSubtarget;
23 class RISCVTargetMachine;
24 class AsmPrinter;
25 class FunctionPass;
26 class InstructionSelector;
27 class MCInst;
28 class MCOperand;
29 class MachineInstr;
30 class MachineOperand;
31 class PassRegistry;
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 *createRISCVMergeBaseOffsetOptPass();
54 void initializeRISCVMergeBaseOffsetOptPass(PassRegistry &);
55 
56 FunctionPass *createRISCVExpandPseudoPass();
57 void initializeRISCVExpandPseudoPass(PassRegistry &);
58 
59 FunctionPass *createRISCVExpandAtomicPseudoPass();
60 void initializeRISCVExpandAtomicPseudoPass(PassRegistry &);
61 
62 FunctionPass *createRISCVInsertVSETVLIPass();
63 void initializeRISCVInsertVSETVLIPass(PassRegistry &);
64 
65 FunctionPass *createRISCVRedundantCopyEliminationPass();
66 void initializeRISCVRedundantCopyEliminationPass(PassRegistry &);
67 
68 InstructionSelector *createRISCVInstructionSelector(const RISCVTargetMachine &,
69                                                     RISCVSubtarget &,
70                                                     RISCVRegisterBankInfo &);
71 }
72 
73 #endif
74