LLVM  8.0.1
RISCVInstrInfo.h
Go to the documentation of this file.
1 //===-- RISCVInstrInfo.h - RISCV Instruction Information --------*- C++ -*-===//
2 //
3 // The LLVM Compiler Infrastructure
4 //
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9 //
10 // This file contains the RISCV implementation of the TargetInstrInfo class.
11 //
12 //===----------------------------------------------------------------------===//
13 
14 #ifndef LLVM_LIB_TARGET_RISCV_RISCVINSTRINFO_H
15 #define LLVM_LIB_TARGET_RISCV_RISCVINSTRINFO_H
16 
17 #include "RISCVRegisterInfo.h"
19 
20 #define GET_INSTRINFO_HEADER
21 #include "RISCVGenInstrInfo.inc"
22 
23 namespace llvm {
24 
26 
27 public:
29 
30  unsigned isLoadFromStackSlot(const MachineInstr &MI,
31  int &FrameIndex) const override;
32  unsigned isStoreToStackSlot(const MachineInstr &MI,
33  int &FrameIndex) const override;
34 
36  const DebugLoc &DL, unsigned DstReg, unsigned SrcReg,
37  bool KillSrc) const override;
38 
40  MachineBasicBlock::iterator MBBI, unsigned SrcReg,
41  bool IsKill, int FrameIndex,
42  const TargetRegisterClass *RC,
43  const TargetRegisterInfo *TRI) const override;
44 
46  MachineBasicBlock::iterator MBBI, unsigned DstReg,
47  int FrameIndex, const TargetRegisterClass *RC,
48  const TargetRegisterInfo *TRI) const override;
49 
50  // Materializes the given int32 Val into DstReg.
52  const DebugLoc &DL, unsigned DstReg, uint64_t Val,
54 
55  unsigned getInstSizeInBytes(const MachineInstr &MI) const override;
56 
58  MachineBasicBlock *&FBB,
60  bool AllowModify) const override;
61 
64  const DebugLoc &dl,
65  int *BytesAdded = nullptr) const override;
66 
68  MachineBasicBlock &NewDestBB,
69  const DebugLoc &DL, int64_t BrOffset,
70  RegScavenger *RS = nullptr) const override;
71 
72  unsigned removeBranch(MachineBasicBlock &MBB,
73  int *BytesRemoved = nullptr) const override;
74 
75  bool
77 
78  MachineBasicBlock *getBranchDestBlock(const MachineInstr &MI) const override;
79 
80  bool isBranchOffsetInRange(unsigned BranchOpc,
81  int64_t BrOffset) const override;
82 };
83 }
84 #endif
This class represents lattice values for constants.
Definition: AllocatorList.h:24
unsigned removeBranch(MachineBasicBlock &MBB, int *BytesRemoved=nullptr) const override
unsigned const TargetRegisterInfo * TRI
A debug info location.
Definition: DebugLoc.h:34
unsigned insertBranch(MachineBasicBlock &MBB, MachineBasicBlock *TBB, MachineBasicBlock *FBB, ArrayRef< MachineOperand > Cond, const DebugLoc &dl, int *BytesAdded=nullptr) const override
void storeRegToStackSlot(MachineBasicBlock &MBB, MachineBasicBlock::iterator MBBI, unsigned SrcReg, bool IsKill, int FrameIndex, const TargetRegisterClass *RC, const TargetRegisterInfo *TRI) const override
unsigned isStoreToStackSlot(const MachineInstr &MI, int &FrameIndex) const override
This class consists of common code factored out of the SmallVector class to reduce code duplication b...
Definition: APFloat.h:42
ArrayRef - Represent a constant reference to an array (0 or more elements consecutively in memory)...
Definition: APInt.h:33
void movImm32(MachineBasicBlock &MBB, MachineBasicBlock::iterator MBBI, const DebugLoc &DL, unsigned DstReg, uint64_t Val, MachineInstr::MIFlag Flag=MachineInstr::NoFlags) const
Flag
These should be considered private to the implementation of the MCInstrDesc class.
Definition: MCInstrDesc.h:118
void copyPhysReg(MachineBasicBlock &MBB, MachineBasicBlock::iterator MBBI, const DebugLoc &DL, unsigned DstReg, unsigned SrcReg, bool KillSrc) const override
TargetRegisterInfo base class - We assume that the target defines a static array of TargetRegisterDes...
unsigned isLoadFromStackSlot(const MachineInstr &MI, int &FrameIndex) const override
bool reverseBranchCondition(SmallVectorImpl< MachineOperand > &Cond) const override
unsigned getInstSizeInBytes(const MachineInstr &MI) const override
bool analyzeBranch(MachineBasicBlock &MBB, MachineBasicBlock *&TBB, MachineBasicBlock *&FBB, SmallVectorImpl< MachineOperand > &Cond, bool AllowModify) const override
Representation of each machine instruction.
Definition: MachineInstr.h:64
unsigned insertIndirectBranch(MachineBasicBlock &MBB, MachineBasicBlock &NewDestBB, const DebugLoc &DL, int64_t BrOffset, RegScavenger *RS=nullptr) const override
MachineBasicBlock * getBranchDestBlock(const MachineInstr &MI) const override
bool isBranchOffsetInRange(unsigned BranchOpc, int64_t BrOffset) const override
IRTranslator LLVM IR MI
void loadRegFromStackSlot(MachineBasicBlock &MBB, MachineBasicBlock::iterator MBBI, unsigned DstReg, int FrameIndex, const TargetRegisterClass *RC, const TargetRegisterInfo *TRI) const override