LLVM  11.0.0git
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  Align Alignment, Register DstReg) const;
32  /// A function of this type is used to perform value split action.
33  using SplitArgTy = std::function<void(ArrayRef<Register>, Register, LLT, LLT, int)>;
35  void splitToValueTypes(MachineIRBuilder &B,
36  const ArgInfo &OrigArgInfo,
37  unsigned OrigArgIdx,
38  SmallVectorImpl<ArgInfo> &SplitArgs,
39  const DataLayout &DL,
40  CallingConv::ID CallConv,
41  SplitArgTy SplitArg) const;
43  bool lowerReturnVal(MachineIRBuilder &B, const Value *Val,
46 public:
49  bool lowerReturn(MachineIRBuilder &B, const Value *Val,
50  ArrayRef<Register> VRegs) const override;
53  ArrayRef<ArrayRef<Register>> VRegs) const;
56  ArrayRef<ArrayRef<Register>> VRegs) const override;
57  static CCAssignFn *CCAssignFnForCall(CallingConv::ID CC, bool IsVarArg);
58  static CCAssignFn *CCAssignFnForReturn(CallingConv::ID CC, bool IsVarArg);
59 };
60 } // End of namespace llvm;
61 #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:43
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")
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:39
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
Promote Memory to Register
Definition: Mem2Reg.cpp:110
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
MachineBasicBlock MachineBasicBlock::iterator DebugLoc DL