Revert r354244 "[DAGCombiner] Eliminate dead stores to stack."
[llvm-complete.git] / lib / Target / AArch64 / AArch64CallLowering.h
blob76337567c7a502ad4756db9a3f572bf666b8fb9b
1 //===- AArch64CallLowering.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_AARCH64_AARCH64CALLLOWERING_H
15 #define LLVM_LIB_TARGET_AARCH64_AARCH64CALLLOWERING_H
17 #include "llvm/ADT/ArrayRef.h"
18 #include "llvm/CodeGen/GlobalISel/CallLowering.h"
19 #include "llvm/IR/CallingConv.h"
20 #include <cstdint>
21 #include <functional>
23 namespace llvm {
25 class AArch64TargetLowering;
26 class CCValAssign;
27 class DataLayout;
28 class MachineIRBuilder;
29 class MachineRegisterInfo;
30 class Type;
32 class AArch64CallLowering: public CallLowering {
33 public:
34 AArch64CallLowering(const AArch64TargetLowering &TLI);
36 bool lowerReturn(MachineIRBuilder &MIRBuilder, const Value *Val,
37 ArrayRef<unsigned> VRegs) const override;
39 bool lowerFormalArguments(MachineIRBuilder &MIRBuilder, const Function &F,
40 ArrayRef<unsigned> VRegs) const override;
42 bool lowerCall(MachineIRBuilder &MIRBuilder, CallingConv::ID CallConv,
43 const MachineOperand &Callee, const ArgInfo &OrigRet,
44 ArrayRef<ArgInfo> OrigArgs) const override;
46 private:
47 using RegHandler = std::function<void(MachineIRBuilder &, Type *, unsigned,
48 CCValAssign &)>;
50 using MemHandler =
51 std::function<void(MachineIRBuilder &, int, CCValAssign &)>;
53 using SplitArgTy = std::function<void(unsigned, uint64_t)>;
55 void splitToValueTypes(const ArgInfo &OrigArgInfo,
56 SmallVectorImpl<ArgInfo> &SplitArgs,
57 const DataLayout &DL, MachineRegisterInfo &MRI,
58 CallingConv::ID CallConv,
59 const SplitArgTy &SplitArg) const;
62 } // end namespace llvm
64 #endif // LLVM_LIB_TARGET_AARCH64_AARCH64CALLLOWERING_H