LLVM  16.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 
19 namespace llvm {
20 
21 class SPIRVGlobalRegistry;
22 class SPIRVTargetLowering;
23 
25 private:
26  // Used to create and assign function, argument, and return type information.
28 
29 public:
31 
32  // Built OpReturn or OpReturnValue.
33  bool lowerReturn(MachineIRBuilder &MIRBuiler, const Value *Val,
35  Register SwiftErrorVReg) const override;
36 
37  // Build OpFunction, OpFunctionParameter, and any EntryPoint or Linkage data.
38  bool lowerFormalArguments(MachineIRBuilder &MIRBuilder, const Function &F,
40  FunctionLoweringInfo &FLI) const override;
41 
42  // Build OpCall, or replace with a builtin function.
43  bool lowerCall(MachineIRBuilder &MIRBuilder,
44  CallLoweringInfo &Info) const override;
45 };
46 } // end namespace llvm
47 
48 #endif // LLVM_LIB_TARGET_SPIRV_SPIRVCALLLOWERING_H
llvm
This is an optimization pass for GlobalISel generic memory operations.
Definition: AddressRanges.h:18
llvm::SPIRVCallLowering::lowerCall
bool lowerCall(MachineIRBuilder &MIRBuilder, CallLoweringInfo &Info) const override
This hook must be implemented to lower the given call instruction, including argument and return valu...
Definition: SPIRVCallLowering.cpp:353
CallLowering.h
llvm::Function
Definition: Function.h:60
llvm::SPIRVCallLowering::SPIRVCallLowering
SPIRVCallLowering(const SPIRVTargetLowering &TLI, SPIRVGlobalRegistry *GR)
Definition: SPIRVCallLowering.cpp:27
F
#define F(x, y, z)
Definition: MD5.cpp:55
Info
Analysis containing CSE Info
Definition: CSEInfo.cpp:27
llvm::SPIRVCallLowering::lowerReturn
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...
Definition: SPIRVCallLowering.cpp:31
llvm::MachineIRBuilder
Helper class to build MachineInstr.
Definition: MachineIRBuilder.h:221
SPIRVGlobalRegistry.h
llvm::FunctionLoweringInfo
FunctionLoweringInfo - This contains information that is global to a function that is used when lower...
Definition: FunctionLoweringInfo.h:52
llvm::SPIRVTargetLowering
Definition: SPIRVISelLowering.h:22
llvm::SPIRVGlobalRegistry
Definition: SPIRVGlobalRegistry.h:27
llvm::SPIRVCallLowering
Definition: SPIRVCallLowering.h:24
llvm::ArrayRef
ArrayRef - Represent a constant reference to an array (0 or more elements consecutively in memory),...
Definition: APInt.h:32
llvm::Register
Wrapper class representing virtual and physical registers.
Definition: Register.h:19
llvm::CallLowering::CallLoweringInfo
Definition: CallLowering.h:102
llvm::SPIRVCallLowering::lowerFormalArguments
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,...
Definition: SPIRVCallLowering.cpp:214
llvm::CallLowering
Definition: CallLowering.h:44
llvm::Value
LLVM Value Representation.
Definition: Value.h:74