LLVM  10.0.0svn
ARMCallLowering.h
Go to the documentation of this file.
1 //===- llvm/lib/Target/ARM/ARMCallLowering.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_ARM_ARMCALLLOWERING_H
15 #define LLVM_LIB_TARGET_ARM_ARMCALLLOWERING_H
16 
17 #include "llvm/ADT/ArrayRef.h"
19 #include "llvm/IR/CallingConv.h"
20 #include <cstdint>
21 #include <functional>
22 
23 namespace llvm {
24 
25 class ARMTargetLowering;
26 class MachineFunction;
27 class MachineInstrBuilder;
28 class MachineIRBuilder;
29 class Value;
30 
31 class ARMCallLowering : public CallLowering {
32 public:
34 
35  bool lowerReturn(MachineIRBuilder &MIRBuilder, const Value *Val,
36  ArrayRef<Register> VRegs) const override;
37 
38  bool lowerFormalArguments(MachineIRBuilder &MIRBuilder, const Function &F,
39  ArrayRef<ArrayRef<Register>> VRegs) const override;
40 
41  bool lowerCall(MachineIRBuilder &MIRBuilder, CallingConv::ID CallConv,
42  const MachineOperand &Callee, const ArgInfo &OrigRet,
43  ArrayRef<ArgInfo> OrigArgs) const override;
44 
45 private:
46  bool lowerReturnVal(MachineIRBuilder &MIRBuilder, const Value *Val,
47  ArrayRef<Register> VRegs,
48  MachineInstrBuilder &Ret) const;
49 
50  /// Split an argument into one or more arguments that the CC lowering can cope
51  /// with.
52  void splitToValueTypes(const ArgInfo &OrigArg,
53  SmallVectorImpl<ArgInfo> &SplitArgs,
54  MachineFunction &MF) const;
55 };
56 
57 } // end namespace llvm
58 
59 #endif // LLVM_LIB_TARGET_ARM_ARMCALLLOWERING_H
This class represents lattice values for constants.
Definition: AllocatorList.h:23
F(f)
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...
ARMCallLowering(const ARMTargetLowering &TLI)
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
Helper class to build MachineInstr.
MachineOperand class - Representation of each machine instruction operand.
amdgpu Simplify well known AMD library false FunctionCallee Callee
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...
bool lowerCall(MachineIRBuilder &MIRBuilder, CallingConv::ID CallConv, const MachineOperand &Callee, const ArgInfo &OrigRet, ArrayRef< ArgInfo > OrigArgs) const override
This hook behaves as the extended lowerCall function, but for targets that do not support swifterror ...
LLVM Value Representation.
Definition: Value.h:72
This file describes how to lower LLVM calls to machine code calls.