[Alignment][NFC] Use Align with TargetLowering::setMinFunctionAlignment
[llvm-core.git] / lib / Target / AMDGPU / AMDGPUCallLowering.h
blob1898c7a4c88e6289faea7025a25f8ef9fe73895d
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 //===----------------------------------------------------------------------===//
14 #ifndef LLVM_LIB_TARGET_AMDGPU_AMDGPUCALLLOWERING_H
15 #define LLVM_LIB_TARGET_AMDGPU_AMDGPUCALLLOWERING_H
17 #include "AMDGPU.h"
18 #include "llvm/CodeGen/GlobalISel/CallLowering.h"
20 namespace llvm {
22 class AMDGPUTargetLowering;
23 class MachineInstrBuilder;
25 class AMDGPUCallLowering: public CallLowering {
26 Register lowerParameterPtr(MachineIRBuilder &MIRBuilder, Type *ParamTy,
27 uint64_t Offset) const;
29 void lowerParameter(MachineIRBuilder &MIRBuilder, Type *ParamTy,
30 uint64_t Offset, unsigned Align,
31 Register DstReg) const;
33 /// A function of this type is used to perform value split action.
34 using SplitArgTy = std::function<void(ArrayRef<Register>, LLT, LLT, int)>;
36 void splitToValueTypes(const ArgInfo &OrigArgInfo,
37 SmallVectorImpl<ArgInfo> &SplitArgs,
38 const DataLayout &DL, MachineRegisterInfo &MRI,
39 CallingConv::ID CallConv,
40 SplitArgTy SplitArg) const;
42 bool lowerReturnVal(MachineIRBuilder &MIRBuilder,
43 const Value *Val, ArrayRef<Register> VRegs,
44 MachineInstrBuilder &Ret) const;
46 public:
47 AMDGPUCallLowering(const AMDGPUTargetLowering &TLI);
49 bool lowerReturn(MachineIRBuilder &MIRBuilder, const Value *Val,
50 ArrayRef<Register> VRegs) const override;
52 bool lowerFormalArgumentsKernel(MachineIRBuilder &MIRBuilder,
53 const Function &F,
54 ArrayRef<ArrayRef<Register>> VRegs) const;
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);
61 } // End of namespace llvm;
62 #endif