• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 //===- lib/Target/AMDGPU/AMDGPUCallLowering.h - Call lowering -*- C++ -*---===//
2 //
3 //                     The LLVM Compiler Infrastructure
4 //
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9 ///
10 /// \file
11 /// This file describes how to lower LLVM calls to machine code calls.
12 ///
13 //===----------------------------------------------------------------------===//
14 
15 #ifndef LLVM_LIB_TARGET_AMDGPU_AMDGPUCALLLOWERING_H
16 #define LLVM_LIB_TARGET_AMDGPU_AMDGPUCALLLOWERING_H
17 
18 #include "AMDGPU.h"
19 #include "llvm/CodeGen/GlobalISel/CallLowering.h"
20 
21 namespace llvm {
22 
23 class AMDGPUTargetLowering;
24 
25 class AMDGPUCallLowering: public CallLowering {
26   AMDGPUAS AMDGPUASI;
27 
28   unsigned lowerParameterPtr(MachineIRBuilder &MIRBuilder, Type *ParamTy,
29                              uint64_t Offset) const;
30 
31   void lowerParameter(MachineIRBuilder &MIRBuilder, Type *ParamTy,
32                       uint64_t Offset, unsigned Align,
33                       unsigned DstReg) const;
34 
35  public:
36   AMDGPUCallLowering(const AMDGPUTargetLowering &TLI);
37 
38   bool lowerReturn(MachineIRBuilder &MIRBuiler, const Value *Val,
39                    unsigned VReg) const override;
40   bool lowerFormalArguments(MachineIRBuilder &MIRBuilder, const Function &F,
41                             ArrayRef<unsigned> VRegs) const override;
42   static CCAssignFn *CCAssignFnForCall(CallingConv::ID CC, bool IsVarArg);
43   static CCAssignFn *CCAssignFnForReturn(CallingConv::ID CC, bool IsVarArg);
44 };
45 } // End of namespace llvm;
46 #endif
47