26 #define GET_INSTRINFO_CTOR_DTOR
27 #include "BPFGenInstrInfo.inc"
36 unsigned DestReg,
unsigned SrcReg,
38 if (BPF::GPRRegClass.
contains(DestReg, SrcReg))
39 BuildMI(MBB, I, DL,
get(BPF::MOV_rr), DestReg)
47 unsigned SrcReg,
bool IsKill,
int FI,
52 DL = I->getDebugLoc();
54 if (RC == &BPF::GPRRegClass)
55 BuildMI(MBB, I, DL,
get(BPF::STD))
65 unsigned DestReg,
int FI,
70 DL = I->getDebugLoc();
72 if (RC == &BPF::GPRRegClass)
82 bool AllowModify)
const {
86 while (I != MBB.
begin()) {
88 if (I->isDebugValue())
93 if (!isUnpredicatedTerminator(I))
102 if (I->getOpcode() == BPF::JMP) {
104 TBB = I->getOperand(0).getMBB();
109 while (std::next(I) != MBB.
end())
123 TBB = I->getOperand(0).getMBB();
139 assert(TBB &&
"InsertBranch must not be told to insert a fallthrough");
143 assert(!FBB &&
"Unconditional branch with multiple successors!");
155 while (I != MBB.
begin()) {
157 if (I->isDebugValue())
159 if (I->getOpcode() != BPF::JMP)
162 I->eraseFromParent();
void eraseFromParent()
eraseFromParent - This method unlinks 'this' from the containing function and deletes it...
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
This class consists of common code factored out of the SmallVector class to reduce code duplication b...
static bool contains(SmallPtrSetImpl< ConstantExpr * > &Cache, ConstantExpr *Expr, Constant *C)
const MachineInstrBuilder & addImm(int64_t Val) const
addImm - Add a new immediate operand.
unsigned RemoveBranch(MachineBasicBlock &MBB) const override
ArrayRef - Represent a constant reference to an array (0 or more elements consecutively in memory)...
unsigned getKillRegState(bool B)
bundle_iterator< MachineInstr, instr_iterator > iterator
bool AnalyzeBranch(MachineBasicBlock &MBB, MachineBasicBlock *&TBB, MachineBasicBlock *&FBB, SmallVectorImpl< MachineOperand > &Cond, bool AllowModify) const override
bool empty() const
empty - Check if the array is empty.
MachineInstrBuilder BuildMI(MachineFunction &MF, DebugLoc DL, const MCInstrDesc &MCID)
BuildMI - Builder interface.
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
void copyPhysReg(MachineBasicBlock &MBB, MachineBasicBlock::iterator I, DebugLoc DL, unsigned DestReg, unsigned SrcReg, bool KillSrc) const override
const MachineInstrBuilder & addFrameIndex(int Idx) const
unsigned InsertBranch(MachineBasicBlock &MBB, MachineBasicBlock *TBB, MachineBasicBlock *FBB, ArrayRef< MachineOperand > Cond, DebugLoc DL) const override
const MachineInstrBuilder & addMBB(MachineBasicBlock *MBB, unsigned char TargetFlags=0) const
void storeRegToStackSlot(MachineBasicBlock &MBB, MachineBasicBlock::iterator MBBI, unsigned SrcReg, bool isKill, int FrameIndex, const TargetRegisterClass *RC, const TargetRegisterInfo *TRI) const override
bool isLayoutSuccessor(const MachineBasicBlock *MBB) const
isLayoutSuccessor - Return true if the specified MBB will be emitted immediately after this block...
const MachineInstrBuilder & addReg(unsigned RegNo, unsigned flags=0, unsigned SubReg=0) const
addReg - Add a new virtual register operand...