LLVM  9.0.0svn
X86CallLowering.h
Go to the documentation of this file.
1 //===- llvm/lib/Target/X86/X86CallLowering.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_X86_X86CALLLOWERING_H
15 #define LLVM_LIB_TARGET_X86_X86CALLLOWERING_H
16 
17 #include "llvm/ADT/ArrayRef.h"
19 #include <functional>
20 
21 namespace llvm {
22 
23 class DataLayout;
24 class MachineRegisterInfo;
25 class X86TargetLowering;
26 
27 class X86CallLowering : public CallLowering {
28 public:
30 
31  bool lowerReturn(MachineIRBuilder &MIRBuilder, const Value *Val,
32  ArrayRef<unsigned> VRegs) const override;
33 
34  bool lowerFormalArguments(MachineIRBuilder &MIRBuilder, const Function &F,
35  ArrayRef<unsigned> VRegs) const override;
36 
37  bool lowerCall(MachineIRBuilder &MIRBuilder, CallingConv::ID CallConv,
38  const MachineOperand &Callee, const ArgInfo &OrigRet,
39  ArrayRef<ArgInfo> OrigArgs) const override;
40 
41 private:
42  /// A function of this type is used to perform value split action.
43  using SplitArgTy = std::function<void(ArrayRef<unsigned>)>;
44 
45  bool splitToValueTypes(const ArgInfo &OrigArgInfo,
46  SmallVectorImpl<ArgInfo> &SplitArgs,
48  SplitArgTy SplitArg) const;
49 };
50 
51 } // end namespace llvm
52 
53 #endif // LLVM_LIB_TARGET_X86_X86CALLLOWERING_H
A parsed version of the target data layout string in and methods for querying it. ...
Definition: DataLayout.h:110
This class represents lattice values for constants.
Definition: AllocatorList.h:23
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...
F(f)
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...
This class consists of common code factored out of the SmallVector class to reduce code duplication b...
Definition: APFloat.h:41
unsigned const MachineRegisterInfo * MRI
Helper class to build MachineInstr.
MachineOperand class - Representation of each machine instruction operand.
amdgpu Simplify well known AMD library false FunctionCallee Callee
MachineRegisterInfo - Keep track of information for virtual and physical registers, including vreg register classes, use/def chains for registers, etc.
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...
LLVM Value Representation.
Definition: Value.h:72
This file describes how to lower LLVM calls to machine code calls.
X86CallLowering(const X86TargetLowering &TLI)