LLVM  10.0.0svn
AMDGPUCallLowering.h
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 //===----------------------------------------------------------------------===//
13 
14 #ifndef LLVM_LIB_TARGET_AMDGPU_AMDGPUCALLLOWERING_H
15 #define LLVM_LIB_TARGET_AMDGPU_AMDGPUCALLLOWERING_H
16 
17 #include "AMDGPU.h"
19 
20 namespace llvm {
21 
22 class AMDGPUTargetLowering;
23 class MachineInstrBuilder;
24 
26  Register lowerParameterPtr(MachineIRBuilder &MIRBuilder, Type *ParamTy,
27  uint64_t Offset) const;
28 
29  void lowerParameter(MachineIRBuilder &MIRBuilder, Type *ParamTy,
30  uint64_t Offset, unsigned Align,
31  Register DstReg) const;
32 
33  /// A function of this type is used to perform value split action.
34  using SplitArgTy = std::function<void(ArrayRef<Register>, LLT, LLT, int)>;
35 
36  void splitToValueTypes(const ArgInfo &OrigArgInfo,
37  SmallVectorImpl<ArgInfo> &SplitArgs,
39  CallingConv::ID CallConv,
40  SplitArgTy SplitArg) const;
41 
42  bool lowerReturnVal(MachineIRBuilder &MIRBuilder,
43  const Value *Val, ArrayRef<Register> VRegs,
44  MachineInstrBuilder &Ret) const;
45 
46 public:
48 
49  bool lowerReturn(MachineIRBuilder &MIRBuilder, const Value *Val,
50  ArrayRef<Register> VRegs) const override;
51 
53  const Function &F,
54  ArrayRef<ArrayRef<Register>> VRegs) const;
55 
56  bool lowerFormalArguments(MachineIRBuilder &MIRBuilder, const Function &F,
57  ArrayRef<ArrayRef<Register>> VRegs) const override;
58  static CCAssignFn *CCAssignFnForCall(CallingConv::ID CC, bool IsVarArg);
59  static CCAssignFn *CCAssignFnForReturn(CallingConv::ID CC, bool IsVarArg);
60 };
61 } // End of namespace llvm;
62 #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)
F(f)
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.
This struct is a compact representation of a valid (non-zero power of two) alignment.
Definition: Alignment.h:40
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:73
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