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
18#define DEBUG_TYPE "bpf-call-lowering"
19
20using namespace llvm;
21
23 : CallLowering(&TLI) {}
24
26 const Value *Val, ArrayRef<Register> VRegs,
28 Register SwiftErrorVReg) const {
29 if (!VRegs.empty())
30 return false;
31 MIRBuilder.buildInstr(BPF::RET);
32 return true;
33}
34
36 const Function &F,
38 FunctionLoweringInfo &FLI) const {
39 return VRegs.empty();
40}
41
43 CallLoweringInfo &Info) const {
44 return false;
45}
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:163
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