26#define GET_REGINFO_TARGET_DESC
27#include "BPFGenRegisterInfo.inc"
32 cl::desc(
"Specify the BPF stack size limit"),
50 return CSR_PreserveAll_RegMask;
67 if (
I.getDebugLoc()) {
75 "Looks like the BPF stack limit is exceeded. "
76 "Please move large on stack variables into BPF per-cpu array map. For "
77 "non-kernel uses, the stack can be increased using -mllvm "
80 F.getContext().diagnose(DiagStackSize);
85 int SPAdj,
unsigned FIOperandNum,
87 assert(SPAdj == 0 &&
"Unexpected");
95 while (!
MI.getOperand(i).isFI()) {
97 assert(i <
MI.getNumOperands() &&
"Instr doesn't have FrameIndex operand!");
101 int FrameIndex =
MI.getOperand(i).getIndex();
104 if (
MI.getOpcode() == BPF::MOV_rr) {
108 MI.getOperand(i).ChangeToRegister(FrameReg,
false);
117 MI.getOperand(i + 1).getImm();
124 if (
MI.getOpcode() == BPF::FI_ri) {
137 MI.eraseFromParent();
139 MI.getOperand(i).ChangeToRegister(FrameReg,
false);
140 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.
@ PreserveAll
Used for runtime calls that preserves (almost) all registers.
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
const uint32_t * getCallPreservedMask(const MachineFunction &MF, CallingConv::ID) const override