LLVM 20.0.0git
BPFCallLowering.cpp
Go to the documentation of this file.
1//===-- BPFCallLowering.cpp - Call lowering for GlobalISel ------*- C++ -*-===//
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/// \file
10/// This file implements the lowering of LLVM calls to machine code calls for
11/// GlobalISel.
12///
13//===----------------------------------------------------------------------===//
14
15#include "BPFCallLowering.h"
17#include "llvm/Support/Debug.h"
18
19#define DEBUG_TYPE "bpf-call-lowering"
20
21using namespace llvm;
22
24 : CallLowering(&TLI) {}
25
27 const Value *Val, ArrayRef<Register> VRegs,
29 Register SwiftErrorVReg) const {
30 if (!VRegs.empty())
31 return false;
32 MIRBuilder.buildInstr(BPF::RET);
33 return true;
34}
35
37 const Function &F,
39 FunctionLoweringInfo &FLI) const {
40 return VRegs.empty();
41}
42
44 CallLoweringInfo &Info) const {
45 return false;
46}
This file describes how to lower LLVM calls to machine code calls.
#define F(x, y, z)
Definition: MD5.cpp:55
This file declares the MachineIRBuilder class.
ArrayRef - Represent a constant reference to an array (0 or more elements consecutively in memory),...
Definition: ArrayRef.h:41
bool empty() const
empty - Check if the array is empty.
Definition: ArrayRef.h:160
bool lowerFormalArguments(MachineIRBuilder &MIRBuilder, const Function &F, ArrayRef< ArrayRef< Register > > VRegs, FunctionLoweringInfo &FLI) const override
This hook must be implemented to lower the incoming (formal) arguments, described by VRegs,...
bool lowerReturn(MachineIRBuilder &MIRBuilder, const Value *Val, ArrayRef< Register > VRegs, FunctionLoweringInfo &FLI, Register SwiftErrorVReg) const override
This hook must be implemented to lower outgoing return values, described by Val, into the specified v...
BPFCallLowering(const BPFTargetLowering &TLI)
bool lowerCall(MachineIRBuilder &MIRBuilder, CallLoweringInfo &Info) const override
This hook must be implemented to lower the given call instruction, including argument and return valu...
FunctionLoweringInfo - This contains information that is global to a function that is used when lower...
Helper class to build MachineInstr.
MachineInstrBuilder buildInstr(unsigned Opcode)
Build and insert <empty> = Opcode <empty>.
Wrapper class representing virtual and physical registers.
Definition: Register.h:19
LLVM Value Representation.
Definition: Value.h:74
This is an optimization pass for GlobalISel generic memory operations.
Definition: AddressRanges.h:18