LLVM  15.0.0git
M68kCallLowering.h
Go to the documentation of this file.
1 //===-- M68kCallLowering.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 implements the lowering of LLVM calls to machine code calls for
11 /// GlobalISel.
12 //
13 //===----------------------------------------------------------------------===//
14 
15 #ifndef LLVM_LIB_TARGET_M68K_GLSEL_M68KCALLLOWERING_H
16 #define LLVM_LIB_TARGET_M68K_GLSEL_M68KCALLLOWERING_H
17 
21 
22 namespace llvm {
23 
24 class M68kTargetLowering;
25 class MachineInstrBuilder;
26 
28  // TODO: We are only supporting return instruction with no value at this time
29  // point
30 
31 public:
33 
34  bool lowerReturn(MachineIRBuilder &MIRBuilder, const Value *Val,
36  Register SwiftErrorVReg) const override;
37 
38  bool lowerFormalArguments(MachineIRBuilder &MIRBuilder, const Function &F,
40  FunctionLoweringInfo &FLI) const override;
41 
42  bool lowerCall(MachineIRBuilder &MIRBuilder,
43  CallLoweringInfo &Info) const override;
44 
45  bool enableBigEndian() const override;
46 };
51 
53 
54 private:
55  void assignValueToReg(Register ValVReg, Register PhysReg,
56  CCValAssign VA) override;
57 
58  void assignValueToAddress(Register ValVReg, Register Addr, LLT MemTy,
59  MachinePointerInfo &MPO, CCValAssign &VA) override;
60 
61  Register getStackAddress(uint64_t Size, int64_t Offset,
62  MachinePointerInfo &MPO,
63  ISD::ArgFlagsTy Flags) override;
64 };
65 
69 };
70 
74  : M68kIncomingValueHandler(MIRBuilder, MRI), MIB(MIB) {}
75 
76 private:
77  void assignValueToReg(Register ValVReg, Register PhysReg,
78  CCValAssign VA) override;
79 
81 };
82 } // end namespace llvm
83 
84 #endif // LLVM_LIB_TARGET_M68K_GLSEL_M68KCALLLOWERING_H
ValueTypes.h
llvm
This is an optimization pass for GlobalISel generic memory operations.
Definition: AddressRanges.h:17
llvm::M68kIncomingValueHandler
Definition: M68kCallLowering.h:47
CallLowering.h
llvm::MachineRegisterInfo
MachineRegisterInfo - Keep track of information for virtual and physical registers,...
Definition: MachineRegisterInfo.h:50
llvm::Function
Definition: Function.h:60
llvm::M68kCallLowering::lowerCall
bool lowerCall(MachineIRBuilder &MIRBuilder, CallLoweringInfo &Info) const override
This hook must be implemented to lower the given call instruction, including argument and return valu...
Definition: M68kCallLowering.cpp:169
F
#define F(x, y, z)
Definition: MD5.cpp:55
llvm::M68kCallLowering::enableBigEndian
bool enableBigEndian() const override
For targets which want to use big-endian can enable it with enableBigEndian() hook.
Definition: M68kCallLowering.cpp:232
llvm::CCValAssign
CCValAssign - Represent assignment of one arg/retval to a location.
Definition: CallingConvLower.h:31
llvm::CallLowering::IncomingValueHandler::IncomingValueHandler
IncomingValueHandler(MachineIRBuilder &MIRBuilder, MachineRegisterInfo &MRI)
Definition: CallLowering.h:316
llvm::FormalArgHandler
Definition: M68kCallLowering.h:66
llvm::CallLowering::IncomingValueHandler
Base class for ValueHandlers used for arguments coming into the current function, or for return value...
Definition: CallLowering.h:315
Info
Analysis containing CSE Info
Definition: CSEInfo.cpp:27
llvm::MachineIRBuilder
Helper class to build MachineInstr.
Definition: MachineIRBuilder.h:219
llvm::MachineInstrBuilder
Definition: MachineInstrBuilder.h:69
uint64_t
llvm::M68kIncomingValueHandler::M68kIncomingValueHandler
M68kIncomingValueHandler(MachineIRBuilder &MIRBuilder, MachineRegisterInfo &MRI)
Definition: M68kCallLowering.h:48
Addr
uint64_t Addr
Definition: ELFObjHandler.cpp:78
llvm::MachinePointerInfo
This class contains a discriminated union of information about pointers in memory operands,...
Definition: MachineMemOperand.h:39
llvm::FunctionLoweringInfo
FunctionLoweringInfo - This contains information that is global to a function that is used when lower...
Definition: FunctionLoweringInfo.h:52
llvm::M68kCallLowering::lowerFormalArguments
bool lowerFormalArguments(MachineIRBuilder &MIRBuilder, const Function &F, ArrayRef< ArrayRef< Register >> VRegs, FunctionLoweringInfo &FLI) const override
This hook must be implemented to lower the incoming (formal) arguments, described by VRegs,...
Definition: M68kCallLowering.cpp:100
llvm::ArrayRef
ArrayRef - Represent a constant reference to an array (0 or more elements consecutively in memory),...
Definition: APInt.h:32
llvm::ISD::ArgFlagsTy
Definition: TargetCallingConv.h:27
llvm::Register
Wrapper class representing virtual and physical registers.
Definition: Register.h:19
CallingConvLower.h
llvm::CallLowering::ValueHandler::MRI
MachineRegisterInfo & MRI
Definition: CallLowering.h:228
llvm::M68kTargetLowering
Definition: M68kISelLowering.h:116
llvm::M68kCallLowering::lowerReturn
bool lowerReturn(MachineIRBuilder &MIRBuilder, const Value *Val, ArrayRef< Register > VRegs, FunctionLoweringInfo &FLI, Register SwiftErrorVReg) const override
This hook must be implemented to lower outgoing return values, described by Val, into the specified v...
Definition: M68kCallLowering.cpp:71
llvm::CallLowering::CallLoweringInfo
Definition: CallLowering.h:102
llvm::CallLowering::ValueHandler::MIRBuilder
MachineIRBuilder & MIRBuilder
Definition: CallLowering.h:227
llvm::M68kCallLowering
Definition: M68kCallLowering.h:27
llvm::M68kCallLowering::M68kCallLowering
M68kCallLowering(const M68kTargetLowering &TLI)
Definition: M68kCallLowering.cpp:28
llvm::CallReturnHandler
Definition: M68kCallLowering.h:71
llvm::M68kIncomingValueHandler::StackUsed
uint64_t StackUsed
Definition: M68kCallLowering.h:52
llvm::CallReturnHandler::CallReturnHandler
CallReturnHandler(MachineIRBuilder &MIRBuilder, MachineRegisterInfo &MRI, MachineInstrBuilder &MIB)
Definition: M68kCallLowering.h:72
llvm::CallLowering
Definition: CallLowering.h:44
llvm::Value
LLVM Value Representation.
Definition: Value.h:74
llvm::FormalArgHandler::FormalArgHandler
FormalArgHandler(MachineIRBuilder &MIRBuilder, MachineRegisterInfo &MRI)
Definition: M68kCallLowering.h:67
llvm::LLT
Definition: LowLevelTypeImpl.h:39