LLVM  8.0.1
ARMCallLowering.h
Go to the documentation of this file.
1 //===- llvm/lib/Target/ARM/ARMCallLowering.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_ARM_ARMCALLLOWERING_H
16 #define LLVM_LIB_TARGET_ARM_ARMCALLLOWERING_H
17 
18 #include "llvm/ADT/ArrayRef.h"
20 #include "llvm/IR/CallingConv.h"
21 #include <cstdint>
22 #include <functional>
23 
24 namespace llvm {
25 
26 class ARMTargetLowering;
27 class MachineFunction;
28 class MachineInstrBuilder;
29 class MachineIRBuilder;
30 class Value;
31 
32 class ARMCallLowering : public CallLowering {
33 public:
35 
36  bool lowerReturn(MachineIRBuilder &MIRBuilder, const Value *Val,
37  ArrayRef<unsigned> VRegs) const override;
38 
39  bool lowerFormalArguments(MachineIRBuilder &MIRBuilder, const Function &F,
40  ArrayRef<unsigned> VRegs) const override;
41 
42  bool lowerCall(MachineIRBuilder &MIRBuilder, CallingConv::ID CallConv,
43  const MachineOperand &Callee, const ArgInfo &OrigRet,
44  ArrayRef<ArgInfo> OrigArgs) const override;
45 
46 private:
47  bool lowerReturnVal(MachineIRBuilder &MIRBuilder, const Value *Val,
48  ArrayRef<unsigned> VRegs,
49  MachineInstrBuilder &Ret) const;
50 
51  using SplitArgTy = std::function<void(unsigned Reg, uint64_t Offset)>;
52 
53  /// Split an argument into one or more arguments that the CC lowering can cope
54  /// with (e.g. replace pointers with integers).
55  void splitToValueTypes(const ArgInfo &OrigArg,
56  SmallVectorImpl<ArgInfo> &SplitArgs,
57  MachineFunction &MF,
58  const SplitArgTy &PerformArgSplit) const;
59 };
60 
61 } // end namespace llvm
62 
63 #endif // LLVM_LIB_TARGET_ARM_ARMCALLLOWERING_H
This class represents lattice values for constants.
Definition: AllocatorList.h:24
F(f)
ARMCallLowering(const ARMTargetLowering &TLI)
This class consists of common code factored out of the SmallVector class to reduce code duplication b...
Definition: APFloat.h:42
amdgpu Simplify well known AMD library false Value * Callee
bool lowerFormalArguments(MachineIRBuilder &MIRBuilder, const Function &F, ArrayRef< unsigned > VRegs) const override
This hook must be implemented to lower the incoming (formal) arguments, described by Args...
Helper class to build MachineInstr.
MachineOperand class - Representation of each machine instruction operand.
bool lowerReturn(MachineIRBuilder &MIRBuilder, const Value *Val, ArrayRef< unsigned > VRegs) const override
This hook must be implemented to lower outgoing return values, described by Val, into the specified v...
bool lowerCall(MachineIRBuilder &MIRBuilder, CallingConv::ID CallConv, const MachineOperand &Callee, const ArgInfo &OrigRet, ArrayRef< ArgInfo > OrigArgs) const override
This hook must be implemented to lower the given call instruction, including argument and return valu...
LLVM Value Representation.
Definition: Value.h:73
This file describes how to lower LLVM calls to machine code calls.