LLVM  10.0.0svn
Go to the documentation of this file.
1 //===- lib/Target/AMDGPU/AMDGPUCallLowering.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 /// \file
10 /// This file describes how to lower LLVM calls to machine code calls.
11 ///
12 //===----------------------------------------------------------------------===//
17 #include "AMDGPU.h"
20 namespace llvm {
22 class AMDGPUTargetLowering;
25  Register lowerParameterPtr(MachineIRBuilder &MIRBuilder, Type *ParamTy,
26  uint64_t Offset) const;
28  void lowerParameter(MachineIRBuilder &MIRBuilder, Type *ParamTy,
29  uint64_t Offset, unsigned Align,
30  Register DstReg) const;
32  /// A function of this type is used to perform value split action.
33  using SplitArgTy = std::function<void(ArrayRef<Register>, LLT, LLT, int)>;
35  void splitToValueTypes(const ArgInfo &OrigArgInfo,
36  SmallVectorImpl<ArgInfo> &SplitArgs,
38  CallingConv::ID CallConv,
39  SplitArgTy SplitArg) const;
41 public:
44  bool lowerReturn(MachineIRBuilder &MIRBuilder, const Value *Val,
45  ArrayRef<Register> VRegs) const override;
48  const Function &F,
49  ArrayRef<ArrayRef<Register>> VRegs) const;
51  bool lowerFormalArguments(MachineIRBuilder &MIRBuilder, const Function &F,
52  ArrayRef<ArrayRef<Register>> VRegs) const override;
53  static CCAssignFn *CCAssignFnForCall(CallingConv::ID CC, bool IsVarArg);
54  static CCAssignFn *CCAssignFnForReturn(CallingConv::ID CC, bool IsVarArg);
55 };
56 } // End of namespace llvm;
57 #endif
A parsed version of the target data layout string in and methods for querying it. ...
Definition: DataLayout.h:110
constexpr char Align[]
Key for Kernel::Arg::Metadata::mAlign.
This class represents lattice values for constants.
Definition: AllocatorList.h:23
static CCAssignFn * CCAssignFnForReturn(CallingConv::ID CC, bool IsVarArg)
bool CCAssignFn(unsigned ValNo, MVT ValVT, MVT LocVT, CCValAssign::LocInfo LocInfo, ISD::ArgFlagsTy ArgFlags, CCState &State)
CCAssignFn - This function assigns a location for Val, updating State to reflect the change...
static CCAssignFn * CCAssignFnForCall(CallingConv::ID CC, bool IsVarArg)
This class consists of common code factored out of the SmallVector class to reduce code duplication b...
Definition: APFloat.h:41
ArrayRef - Represent a constant reference to an array (0 or more elements consecutively in memory)...
Definition: APInt.h:32
unsigned const MachineRegisterInfo * MRI
The instances of the Type class are immutable: once they are created, they are never changed...
Definition: Type.h:45
bool lowerFormalArguments(MachineIRBuilder &MIRBuilder, const Function &F, ArrayRef< ArrayRef< Register >> VRegs) const override
This hook must be implemented to lower the incoming (formal) arguments, described by VRegs...
Helper class to build MachineInstr.
bool lowerReturn(MachineIRBuilder &MIRBuilder, const Value *Val, ArrayRef< Register > VRegs) const override
This hook behaves as the extended lowerReturn function, but for targets that do not support swifterro...
bool lowerFormalArgumentsKernel(MachineIRBuilder &MIRBuilder, const Function &F, ArrayRef< ArrayRef< Register >> VRegs) const
MachineRegisterInfo - Keep track of information for virtual and physical registers, including vreg register classes, use/def chains for registers, etc.
LLVM Value Representation.
Definition: Value.h:72
This file describes how to lower LLVM calls to machine code calls.
AMDGPUCallLowering(const AMDGPUTargetLowering &TLI)
Wrapper class representing virtual and physical registers.
Definition: Register.h:18