LLVM 23.0.0git
BPFFrameLowering.cpp
Go to the documentation of this file.
1//===-- BPFFrameLowering.cpp - BPF Frame Information ----------------------===//
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 TargetFrameLowering class.
10//
11//===----------------------------------------------------------------------===//
12
13#include "BPFFrameLowering.h"
14#include "BPFSubtarget.h"
17
18using namespace llvm;
19
21 return true;
22}
23
26
29
31 BitVector &SavedRegs,
32 RegScavenger *RS) const {
34 SavedRegs.reset(BPF::R6);
35 SavedRegs.reset(BPF::R7);
36 SavedRegs.reset(BPF::R8);
37 SavedRegs.reset(BPF::R9);
38}
39
41 int FI,
42 Register &FrameReg) const {
43 const MachineFrameInfo &MFI = MF.getFrameInfo();
45
46 FrameReg = RI->getFrameRegister(MF);
47
49}
MachineBasicBlock & MBB
void emitPrologue(MachineFunction &MF, MachineBasicBlock &MBB) const override
emitProlog/emitEpilog - These methods insert prolog and epilog code into the function.
StackOffset getFrameIndexReference(const MachineFunction &MF, int FI, Register &FrameReg) const override
getFrameIndexReference - This method should return the base register and offset used to reference a f...
void emitEpilogue(MachineFunction &MF, MachineBasicBlock &MBB) const override
void determineCalleeSaves(MachineFunction &MF, BitVector &SavedRegs, RegScavenger *RS) const override
This method determines which of the registers reported by TargetRegisterInfo::getCalleeSavedRegs() sh...
bool hasFPImpl(const MachineFunction &MF) const override
BitVector & reset()
Reset all bits in the bitvector.
Definition BitVector.h:409
The MachineFrameInfo class represents an abstract stack frame until prolog/epilog code is inserted.
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.
Wrapper class representing virtual and physical registers.
Definition Register.h:20
StackOffset holds a fixed and a scalable offset in bytes.
Definition TypeSize.h:30
int64_t getFixed() const
Returns the fixed component of the stack.
Definition TypeSize.h:46
virtual void determineCalleeSaves(MachineFunction &MF, BitVector &SavedRegs, RegScavenger *RS=nullptr) const
This method determines which of the registers reported by TargetRegisterInfo::getCalleeSavedRegs() sh...
TargetRegisterInfo base class - We assume that the target defines a static array of TargetRegisterDes...
virtual Register getFrameRegister(const MachineFunction &MF) const =0
Debug information queries.
virtual const TargetRegisterInfo * getRegisterInfo() const =0
Return the target's register information.
This is an optimization pass for GlobalISel generic memory operations.