LLVM  13.0.0git
BPFInstrInfo.h
Go to the documentation of this file.
1 //===-- BPFInstrInfo.h - BPF Instruction Information ------------*- 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 BPF implementation of the TargetInstrInfo class.
10 //
11 //===----------------------------------------------------------------------===//
12 
13 #ifndef LLVM_LIB_TARGET_BPF_BPFINSTRINFO_H
14 #define LLVM_LIB_TARGET_BPF_BPFINSTRINFO_H
15 
16 #include "BPFRegisterInfo.h"
18 
19 #define GET_INSTRINFO_HEADER
20 #include "BPFGenInstrInfo.inc"
21 
22 namespace llvm {
23 
24 class BPFInstrInfo : public BPFGenInstrInfo {
25  const BPFRegisterInfo RI;
26 
27 public:
28  BPFInstrInfo();
29 
30  const BPFRegisterInfo &getRegisterInfo() const { return RI; }
31 
33  const DebugLoc &DL, MCRegister DestReg, MCRegister SrcReg,
34  bool KillSrc) const override;
35 
36  bool expandPostRAPseudo(MachineInstr &MI) const override;
37 
40  bool isKill, int FrameIndex,
41  const TargetRegisterClass *RC,
42  const TargetRegisterInfo *TRI) const override;
43 
46  int FrameIndex, const TargetRegisterClass *RC,
47  const TargetRegisterInfo *TRI) const override;
49  MachineBasicBlock *&FBB,
51  bool AllowModify) const override;
52 
54  int *BytesRemoved = nullptr) const override;
57  const DebugLoc &DL,
58  int *BytesAdded = nullptr) const override;
59 private:
60  void expandMEMCPY(MachineBasicBlock::iterator) const;
61 
62 };
63 }
64 
65 #endif
llvm::BPFInstrInfo
Definition: BPFInstrInfo.h:24
llvm::BPFRegisterInfo
Definition: BPFRegisterInfo.h:23
MI
IRTranslator LLVM IR MI
Definition: IRTranslator.cpp:102
llvm
Definition: AllocatorList.h:23
llvm::TargetRegisterInfo
TargetRegisterInfo base class - We assume that the target defines a static array of TargetRegisterDes...
Definition: TargetRegisterInfo.h:231
TargetInstrInfo.h
TRI
unsigned const TargetRegisterInfo * TRI
Definition: MachineSink.cpp:1567
llvm::BPFInstrInfo::expandPostRAPseudo
bool expandPostRAPseudo(MachineInstr &MI) const override
Definition: BPFInstrInfo.cpp:115
llvm::TargetRegisterClass
Definition: TargetRegisterInfo.h:46
llvm::MachineBasicBlock
Definition: MachineBasicBlock.h:95
llvm::BPFInstrInfo::copyPhysReg
void copyPhysReg(MachineBasicBlock &MBB, MachineBasicBlock::iterator I, const DebugLoc &DL, MCRegister DestReg, MCRegister SrcReg, bool KillSrc) const override
Definition: BPFInstrInfo.cpp:31
llvm::MachineInstr
Representation of each machine instruction.
Definition: MachineInstr.h:64
I
#define I(x, y, z)
Definition: MD5.cpp:59
llvm::BPFInstrInfo::storeRegToStackSlot
void storeRegToStackSlot(MachineBasicBlock &MBB, MachineBasicBlock::iterator MBBI, Register SrcReg, bool isKill, int FrameIndex, const TargetRegisterClass *RC, const TargetRegisterInfo *TRI) const override
Definition: BPFInstrInfo.cpp:124
BPFGenInstrInfo
llvm::BPFInstrInfo::analyzeBranch
bool analyzeBranch(MachineBasicBlock &MBB, MachineBasicBlock *&TBB, MachineBasicBlock *&FBB, SmallVectorImpl< MachineOperand > &Cond, bool AllowModify) const override
Definition: BPFInstrInfo.cpp:164
llvm::ArrayRef
ArrayRef - Represent a constant reference to an array (0 or more elements consecutively in memory),...
Definition: APInt.h:32
Cond
SmallVector< MachineOperand, 4 > Cond
Definition: BasicBlockSections.cpp:167
MBBI
MachineBasicBlock MachineBasicBlock::iterator MBBI
Definition: AArch64SLSHardening.cpp:75
DL
MachineBasicBlock MachineBasicBlock::iterator DebugLoc DL
Definition: AArch64SLSHardening.cpp:76
llvm::BPFInstrInfo::loadRegFromStackSlot
void loadRegFromStackSlot(MachineBasicBlock &MBB, MachineBasicBlock::iterator MBBI, Register DestReg, int FrameIndex, const TargetRegisterClass *RC, const TargetRegisterInfo *TRI) const override
Definition: BPFInstrInfo.cpp:147
llvm::BPFInstrInfo::getRegisterInfo
const BPFRegisterInfo & getRegisterInfo() const
Definition: BPFInstrInfo.h:30
llvm::BPFInstrInfo::removeBranch
unsigned removeBranch(MachineBasicBlock &MBB, int *BytesRemoved=nullptr) const override
Definition: BPFInstrInfo.cpp:240
llvm::Register
Wrapper class representing virtual and physical registers.
Definition: Register.h:19
llvm::ISD::FrameIndex
@ FrameIndex
Definition: ISDOpcodes.h:73
MBB
MachineBasicBlock & MBB
Definition: AArch64SLSHardening.cpp:74
llvm::BPFInstrInfo::BPFInstrInfo
BPFInstrInfo()
Definition: BPFInstrInfo.cpp:28
llvm::SmallVectorImpl
This class consists of common code factored out of the SmallVector class to reduce code duplication b...
Definition: APFloat.h:43
BPFRegisterInfo.h
llvm::DebugLoc
A debug info location.
Definition: DebugLoc.h:33
llvm::BPFInstrInfo::insertBranch
unsigned insertBranch(MachineBasicBlock &MBB, MachineBasicBlock *TBB, MachineBasicBlock *FBB, ArrayRef< MachineOperand > Cond, const DebugLoc &DL, int *BytesAdded=nullptr) const override
Definition: BPFInstrInfo.cpp:219
llvm::MachineInstrBundleIterator< MachineInstr >
llvm::MCRegister
Wrapper class representing physical registers. Should be passed by value.
Definition: MCRegister.h:23