LLVM  8.0.1
BPFInstrInfo.h
Go to the documentation of this file.
1 //===-- BPFInstrInfo.h - BPF 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 BPF implementation of the TargetInstrInfo class.
11 //
12 //===----------------------------------------------------------------------===//
13 
14 #ifndef LLVM_LIB_TARGET_BPF_BPFINSTRINFO_H
15 #define LLVM_LIB_TARGET_BPF_BPFINSTRINFO_H
16 
17 #include "BPFRegisterInfo.h"
19 
20 #define GET_INSTRINFO_HEADER
21 #include "BPFGenInstrInfo.inc"
22 
23 namespace llvm {
24 
25 class BPFInstrInfo : public BPFGenInstrInfo {
26  const BPFRegisterInfo RI;
27 
28 public:
29  BPFInstrInfo();
30 
31  const BPFRegisterInfo &getRegisterInfo() const { return RI; }
32 
34  const DebugLoc &DL, unsigned DestReg, unsigned SrcReg,
35  bool KillSrc) const override;
36 
37  bool expandPostRAPseudo(MachineInstr &MI) 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 DestReg,
47  int FrameIndex, const TargetRegisterClass *RC,
48  const TargetRegisterInfo *TRI) const override;
50  MachineBasicBlock *&FBB,
52  bool AllowModify) const override;
53 
54  unsigned removeBranch(MachineBasicBlock &MBB,
55  int *BytesRemoved = nullptr) const override;
58  const DebugLoc &DL,
59  int *BytesAdded = nullptr) const override;
60 private:
61  void expandMEMCPY(MachineBasicBlock::iterator) const;
62 
63 };
64 }
65 
66 #endif
This class represents lattice values for constants.
Definition: AllocatorList.h:24
void copyPhysReg(MachineBasicBlock &MBB, MachineBasicBlock::iterator I, const DebugLoc &DL, unsigned DestReg, unsigned SrcReg, bool KillSrc) const override
unsigned insertBranch(MachineBasicBlock &MBB, MachineBasicBlock *TBB, MachineBasicBlock *FBB, ArrayRef< MachineOperand > Cond, const DebugLoc &DL, int *BytesAdded=nullptr) const override
unsigned const TargetRegisterInfo * TRI
A debug info location.
Definition: DebugLoc.h:34
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
unsigned removeBranch(MachineBasicBlock &MBB, int *BytesRemoved=nullptr) const override
bool analyzeBranch(MachineBasicBlock &MBB, MachineBasicBlock *&TBB, MachineBasicBlock *&FBB, SmallVectorImpl< MachineOperand > &Cond, bool AllowModify) const override
const BPFRegisterInfo & getRegisterInfo() const
Definition: BPFInstrInfo.h:31
TargetRegisterInfo base class - We assume that the target defines a static array of TargetRegisterDes...
void loadRegFromStackSlot(MachineBasicBlock &MBB, MachineBasicBlock::iterator MBBI, unsigned DestReg, int FrameIndex, const TargetRegisterClass *RC, const TargetRegisterInfo *TRI) const override
bool expandPostRAPseudo(MachineInstr &MI) const override
Representation of each machine instruction.
Definition: MachineInstr.h:64
#define I(x, y, z)
Definition: MD5.cpp:58
IRTranslator LLVM IR MI
void storeRegToStackSlot(MachineBasicBlock &MBB, MachineBasicBlock::iterator MBBI, unsigned SrcReg, bool isKill, int FrameIndex, const TargetRegisterClass *RC, const TargetRegisterInfo *TRI) const override