25#define GET_REGINFO_TARGET_DESC
26#include "BPFGenRegisterInfo.inc"
31 cl::desc(
"Specify the BPF stack size limit"),
49 return CSR_PreserveAll_RegMask;
66 if (
I.getDebugLoc()) {
74 "Looks like the BPF stack limit is exceeded. "
75 "Please move large on stack variables into BPF per-cpu array map. For "
76 "non-kernel uses, the stack can be increased using -mllvm "
79 F.getContext().diagnose(DiagStackSize);
84 int SPAdj,
unsigned FIOperandNum,
86 assert(SPAdj == 0 &&
"Unexpected");
94 while (!
MI.getOperand(i).isFI()) {
96 assert(i <
MI.getNumOperands() &&
"Instr doesn't have FrameIndex operand!");
100 int FrameIndex =
MI.getOperand(i).getIndex();
103 if (
MI.getOpcode() == BPF::MOV_rr) {
107 MI.getOperand(i).ChangeToRegister(FrameReg,
false);
116 MI.getOperand(i + 1).getImm();
123 if (
MI.getOpcode() == BPF::FI_ri) {
136 MI.eraseFromParent();
138 MI.getOperand(i).ChangeToRegister(FrameReg,
false);
139 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