LLVM 19.0.0git
SPIRVCallLowering.h
Go to the documentation of this file.
1//===--- SPIRVCallLowering.h - Call lowering --------------------*- 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// This file describes how to lower LLVM calls to machine code calls.
10//
11//===----------------------------------------------------------------------===//
12
13#ifndef LLVM_LIB_TARGET_SPIRV_SPIRVCALLLOWERING_H
14#define LLVM_LIB_TARGET_SPIRV_SPIRVCALLLOWERING_H
15
16#include "SPIRVGlobalRegistry.h"
18
19namespace llvm {
20
21class SPIRVGlobalRegistry;
22class SPIRVTargetLowering;
23
25private:
26 // Used to create and assign function, argument, and return type information.
28
29 // Used to postpone producing of indirect function pointer types
30 // after all indirect calls info is collected
31 struct SPIRVIndirectCall {
32 const Type *RetTy = nullptr;
35 Register Callee;
36 };
37 void produceIndirectPtrTypes(MachineIRBuilder &MIRBuilder) const;
38 mutable SmallVector<SPIRVIndirectCall> IndirectCalls;
39
40public:
42
43 // Built OpReturn or OpReturnValue.
44 bool lowerReturn(MachineIRBuilder &MIRBuiler, const Value *Val,
46 Register SwiftErrorVReg) const override;
47
48 // Build OpFunction, OpFunctionParameter, and any EntryPoint or Linkage data.
49 bool lowerFormalArguments(MachineIRBuilder &MIRBuilder, const Function &F,
51 FunctionLoweringInfo &FLI) const override;
52
53 // Build OpCall, or replace with a builtin function.
54 bool lowerCall(MachineIRBuilder &MIRBuilder,
55 CallLoweringInfo &Info) const override;
56};
57} // end namespace llvm
58
59#endif // LLVM_LIB_TARGET_SPIRV_SPIRVCALLLOWERING_H
Analysis containing CSE Info
Definition: CSEInfo.cpp:27
This file describes how to lower LLVM calls to machine code calls.
return RetTy
#define F(x, y, z)
Definition: MD5.cpp:55
ArrayRef - Represent a constant reference to an array (0 or more elements consecutively in memory),...
Definition: ArrayRef.h:41
FunctionLoweringInfo - This contains information that is global to a function that is used when lower...
Helper class to build MachineInstr.
Wrapper class representing virtual and physical registers.
Definition: Register.h:19
bool lowerCall(MachineIRBuilder &MIRBuilder, CallLoweringInfo &Info) const override
This hook must be implemented to lower the given call instruction, including argument and return valu...
bool lowerReturn(MachineIRBuilder &MIRBuiler, 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...
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,...
This is a 'vector' (really, a variable-sized array), optimized for the case when the array is small.
Definition: SmallVector.h:1209
The instances of the Type class are immutable: once they are created, they are never changed.
Definition: Type.h:45
LLVM Value Representation.
Definition: Value.h:74
This is an optimization pass for GlobalISel generic memory operations.
Definition: AddressRanges.h:18