26#define GET_REGINFO_TARGET_DESC
27#include "BPFGenRegisterInfo.inc"
32 cl::desc(
"Specify the BPF stack size limit"),
56 if (
I.getDebugLoc()) {
64 "Looks like the BPF stack limit is exceeded. "
65 "Please move large on stack variables into BPF per-cpu array map. For "
66 "non-kernel uses, the stack can be increased using -mllvm "
69 F.getContext().diagnose(DiagStackSize);
74 int SPAdj,
unsigned FIOperandNum,
76 assert(SPAdj == 0 &&
"Unexpected");
84 while (!
MI.getOperand(i).isFI()) {
86 assert(i <
MI.getNumOperands() &&
"Instr doesn't have FrameIndex operand!");
90 int FrameIndex =
MI.getOperand(i).getIndex();
93 if (
MI.getOpcode() == BPF::MOV_rr) {
97 MI.getOperand(i).ChangeToRegister(FrameReg,
false);
106 MI.getOperand(i + 1).getImm();
113 if (
MI.getOpcode() == BPF::FI_ri) {
126 MI.eraseFromParent();
128 MI.getOperand(i).ChangeToRegister(FrameReg,
false);
129 MI.getOperand(i + 1).ChangeToImmediate(
Offset);
MachineBasicBlock MachineBasicBlock::iterator DebugLoc DL
static void WarnSize(int Offset, MachineFunction &MF, DebugLoc &DL, MachineBasicBlock &MBB)
static cl::opt< int > BPFStackSizeOption("bpf-stack-size", cl::desc("Specify the BPF stack size limit"), cl::init(512))
const HexagonInstrInfo * TII
uint64_t IntrinsicInst * II
This file declares the machine register scavenger class.
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
Diagnostic information for unsupported feature in backend.
const MachineFunction * getParent() const
Return the MachineFunction containing this basic block.
int64_t getObjectOffset(int ObjectIdx) const
Return the assigned stack offset of the specified object from the incoming stack pointer.
const TargetSubtargetInfo & getSubtarget() const
getSubtarget - Return the subtarget for which this machine code is being compiled.
MachineFrameInfo & getFrameInfo()
getFrameInfo - Return the frame info object for the current function.
Function & getFunction()
Return the LLVM function that this machine code represents.
const MachineInstrBuilder & addImm(int64_t Val) const
Add a new immediate operand.
const MachineInstrBuilder & addReg(Register RegNo, unsigned flags=0, unsigned SubReg=0) const
Add a new virtual register operand.
Representation of each machine instruction.
Wrapper class representing virtual and physical registers.
TargetInstrInfo - Interface to description of machine instruction set.
virtual const TargetInstrInfo * getInstrInfo() const
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
initializer< Ty > init(const Ty &Val)
This is an optimization pass for GlobalISel generic memory operations.
MachineInstrBuilder BuildMI(MachineFunction &MF, const MIMetadata &MIMD, const MCInstrDesc &MCID)
Builder interface. Specify how to create the initial instruction itself.
const MCPhysReg * getCalleeSavedRegs(const MachineFunction *MF) const override
BitVector getReservedRegs(const MachineFunction &MF) const override
Register getFrameRegister(const MachineFunction &MF) const override
bool eliminateFrameIndex(MachineBasicBlock::iterator MI, int SPAdj, unsigned FIOperandNum, RegScavenger *RS=nullptr) const override