LLVM 22.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
22namespace llvm {
23class BPFSubtarget;
24
26 const BPFRegisterInfo RI;
27
28public:
29 explicit BPFInstrInfo(const BPFSubtarget &STI);
30
31 const BPFRegisterInfo &getRegisterInfo() const { return RI; }
32
34 const DebugLoc &DL, Register DestReg, Register SrcReg,
35 bool KillSrc, bool RenamableDest = false,
36 bool RenamableSrc = false) const override;
37
38 bool expandPostRAPseudo(MachineInstr &MI) const override;
39
42 bool isKill, int FrameIndex, const TargetRegisterClass *RC,
43 const TargetRegisterInfo *TRI, Register VReg,
44 MachineInstr::MIFlag Flags = MachineInstr::NoFlags) const override;
45
48 Register DestReg, int FrameIndex, const TargetRegisterClass *RC,
49 const TargetRegisterInfo *TRI, Register VReg,
50 MachineInstr::MIFlag Flags = MachineInstr::NoFlags) const override;
54 bool AllowModify) const override;
55
57 int *BytesRemoved = nullptr) const override;
60 const DebugLoc &DL,
61 int *BytesAdded = nullptr) const override;
62
63 int getJumpTableIndex(const MachineInstr &MI) const override;
64
65private:
66 void expandMEMCPY(MachineBasicBlock::iterator) const;
67
68};
69}
70
71#endif
MachineBasicBlock & MBB
MachineBasicBlock MachineBasicBlock::iterator DebugLoc DL
MachineBasicBlock MachineBasicBlock::iterator MBBI
IRTranslator LLVM IR MI
#define I(x, y, z)
Definition MD5.cpp:58
Register const TargetRegisterInfo * TRI
const SmallVectorImpl< MachineOperand > MachineBasicBlock * TBB
const SmallVectorImpl< MachineOperand > & Cond
ArrayRef - Represent a constant reference to an array (0 or more elements consecutively in memory),...
Definition ArrayRef.h:41
unsigned insertBranch(MachineBasicBlock &MBB, MachineBasicBlock *TBB, MachineBasicBlock *FBB, ArrayRef< MachineOperand > Cond, const DebugLoc &DL, int *BytesAdded=nullptr) const override
int getJumpTableIndex(const MachineInstr &MI) const override
void loadRegFromStackSlot(MachineBasicBlock &MBB, MachineBasicBlock::iterator MBBI, Register DestReg, int FrameIndex, const TargetRegisterClass *RC, const TargetRegisterInfo *TRI, Register VReg, MachineInstr::MIFlag Flags=MachineInstr::NoFlags) const override
void storeRegToStackSlot(MachineBasicBlock &MBB, MachineBasicBlock::iterator MBBI, Register SrcReg, bool isKill, int FrameIndex, const TargetRegisterClass *RC, const TargetRegisterInfo *TRI, Register VReg, MachineInstr::MIFlag Flags=MachineInstr::NoFlags) const override
const BPFRegisterInfo & getRegisterInfo() const
void copyPhysReg(MachineBasicBlock &MBB, MachineBasicBlock::iterator I, const DebugLoc &DL, Register DestReg, Register SrcReg, bool KillSrc, bool RenamableDest=false, bool RenamableSrc=false) const override
bool analyzeBranch(MachineBasicBlock &MBB, MachineBasicBlock *&TBB, MachineBasicBlock *&FBB, SmallVectorImpl< MachineOperand > &Cond, bool AllowModify) const override
bool expandPostRAPseudo(MachineInstr &MI) const override
BPFInstrInfo(const BPFSubtarget &STI)
unsigned removeBranch(MachineBasicBlock &MBB, int *BytesRemoved=nullptr) const override
A debug info location.
Definition DebugLoc.h:124
MachineInstrBundleIterator< MachineInstr > iterator
Representation of each machine instruction.
Wrapper class representing virtual and physical registers.
Definition Register.h:19
This class consists of common code factored out of the SmallVector class to reduce code duplication b...
TargetRegisterInfo base class - We assume that the target defines a static array of TargetRegisterDes...
This is an optimization pass for GlobalISel generic memory operations.