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;
23 class MachineInstrBuilder;
26  Register lowerParameterPtr(MachineIRBuilder &B, Type *ParamTy,
27  uint64_t Offset) const;
29  void lowerParameter(MachineIRBuilder &B, Type *ParamTy, uint64_t Offset,
30  unsigned Align, 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  bool lowerReturnVal(MachineIRBuilder &B, const Value *Val,
44 public:
47  bool lowerReturn(MachineIRBuilder &B, const Value *Val,
48  ArrayRef<Register> VRegs) const override;
51  ArrayRef<ArrayRef<Register>> VRegs) const;
54  ArrayRef<ArrayRef<Register>> VRegs) const override;
55  static CCAssignFn *CCAssignFnForCall(CallingConv::ID CC, bool IsVarArg);
56  static CCAssignFn *CCAssignFnForReturn(CallingConv::ID CC, bool IsVarArg);
57 };
58 } // End of namespace llvm;
59 #endif
A parsed version of the target data layout string in and methods for querying it. ...
Definition: DataLayout.h:111
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
static GCRegistry::Add< OcamlGC > B("ocaml", "ocaml 3.10-compatible GC")
unsigned const MachineRegisterInfo * MRI
The instances of the Type class are immutable: once they are created, they are never changed...
Definition: Type.h:46
Helper class to build MachineInstr.
This struct is a compact representation of a valid (non-zero power of two) alignment.
Definition: Alignment.h:40
bool lowerFormalArguments(MachineIRBuilder &B, const Function &F, ArrayRef< ArrayRef< Register >> VRegs) const override
This hook must be implemented to lower the incoming (formal) arguments, described by VRegs...
bool lowerFormalArgumentsKernel(MachineIRBuilder &B, 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.
bool lowerReturn(MachineIRBuilder &B, const Value *Val, ArrayRef< Register > VRegs) const override
This hook behaves as the extended lowerReturn function, but for targets that do not support swifterro...
LLVM Value Representation.
Definition: Value.h:74
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:19