LLVM  10.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<Register> VRegs) const override;
33 
34  bool lowerFormalArguments(MachineIRBuilder &MIRBuilder, const Function &F,
35  ArrayRef<ArrayRef<Register>> VRegs) const override;
36 
37  bool lowerCall(MachineIRBuilder &MIRBuilder,
38  CallLoweringInfo &Info) const override;
39 
40 private:
41  /// A function of this type is used to perform value split action.
42  using SplitArgTy = std::function<void(ArrayRef<Register>)>;
43 
44  bool splitToValueTypes(const ArgInfo &OrigArgInfo,
45  SmallVectorImpl<ArgInfo> &SplitArgs,
47  SplitArgTy SplitArg) const;
48 };
49 
50 } // end namespace llvm
51 
52 #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:111
This class represents lattice values for constants.
Definition: AllocatorList.h:23
bool lowerCall(MachineIRBuilder &MIRBuilder, CallLoweringInfo &Info) const override
This hook must be implemented to lower the given call instruction, including argument and return valu...
F(f)
This class consists of common code factored out of the SmallVector class to reduce code duplication b...
Definition: APFloat.h:41
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...
ArrayRef - Represent a constant reference to an array (0 or more elements consecutively in memory)...
Definition: APInt.h:32
Analysis containing CSE Info
Definition: CSEInfo.cpp:20
unsigned const MachineRegisterInfo * MRI
Helper class to build MachineInstr.
MachineRegisterInfo - Keep track of information for virtual and physical registers, including vreg register classes, use/def chains for registers, etc.
LLVM Value Representation.
Definition: Value.h:73
This file describes how to lower LLVM calls to machine code calls.
X86CallLowering(const X86TargetLowering &TLI)
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...