LLVM  14.0.0git
Public Member Functions | Public Attributes | List of all members
llvm::CallLowering::ValueHandler Struct Referenceabstract

#include "llvm/CodeGen/GlobalISel/CallLowering.h"

Inheritance diagram for llvm::CallLowering::ValueHandler:
Inheritance graph
[legend]
Collaboration diagram for llvm::CallLowering::ValueHandler:
Collaboration graph
[legend]

Public Member Functions

 ValueHandler (bool IsIncoming, MachineIRBuilder &MIRBuilder, MachineRegisterInfo &MRI)
 
virtual ~ValueHandler ()=default
 
bool isIncomingArgumentHandler () const
 Returns true if the handler is dealing with incoming arguments, i.e. More...
 
virtual Register getStackAddress (uint64_t MemSize, int64_t Offset, MachinePointerInfo &MPO, ISD::ArgFlagsTy Flags)=0
 Materialize a VReg containing the address of the specified stack-based object. More...
 
virtual LLT getStackValueStoreType (const DataLayout &DL, const CCValAssign &VA, ISD::ArgFlagsTy Flags) const
 Return the in-memory size to write for the argument at VA. More...
 
virtual void assignValueToReg (Register ValVReg, Register PhysReg, CCValAssign VA)=0
 The specified value has been assigned to a physical register, handle the appropriate COPY (either to or from) and mark any relevant uses/defines as needed. More...
 
virtual void assignValueToAddress (Register ValVReg, Register Addr, LLT MemTy, MachinePointerInfo &MPO, CCValAssign &VA)=0
 The specified value has been assigned to a stack location. More...
 
virtual void assignValueToAddress (const ArgInfo &Arg, unsigned ValRegIndex, Register Addr, LLT MemTy, MachinePointerInfo &MPO, CCValAssign &VA)
 An overload which takes an ArgInfo if additional information about the arg is needed. More...
 
virtual unsigned assignCustomValue (ArgInfo &Arg, ArrayRef< CCValAssign > VAs, std::function< void()> *Thunk=nullptr)
 Handle custom values, which may be passed into one or more of VAs. More...
 
void copyArgumentMemory (const ArgInfo &Arg, Register DstPtr, Register SrcPtr, const MachinePointerInfo &DstPtrInfo, Align DstAlign, const MachinePointerInfo &SrcPtrInfo, Align SrcAlign, uint64_t MemSize, CCValAssign &VA) const
 Do a memory copy of MemSize bytes from SrcPtr to DstPtr. More...
 
Register extendRegister (Register ValReg, CCValAssign &VA, unsigned MaxSizeBits=0)
 Extend a register to the location type given in VA, capped at extending to at most MaxSize bits. More...
 

Public Attributes

MachineIRBuilderMIRBuilder
 
MachineRegisterInfoMRI
 
const bool IsIncomingArgumentHandler
 

Detailed Description

Definition at line 225 of file CallLowering.h.

Constructor & Destructor Documentation

◆ ValueHandler()

llvm::CallLowering::ValueHandler::ValueHandler ( bool  IsIncoming,
MachineIRBuilder MIRBuilder,
MachineRegisterInfo MRI 
)
inline

Definition at line 230 of file CallLowering.h.

◆ ~ValueHandler()

virtual llvm::CallLowering::ValueHandler::~ValueHandler ( )
virtualdefault

Member Function Documentation

◆ assignCustomValue()

virtual unsigned llvm::CallLowering::ValueHandler::assignCustomValue ( ArgInfo Arg,
ArrayRef< CCValAssign VAs,
std::function< void()> *  Thunk = nullptr 
)
inlinevirtual

Handle custom values, which may be passed into one or more of VAs.

If the handler wants the assignments to be delayed until after mem loc assignments, then it sets Thunk to the thunk to do the assignment.

Returns
The number of VAs that have been assigned after the first one, and which should therefore be skipped from further processing.

Definition at line 291 of file CallLowering.h.

References llvm_unreachable.

Referenced by llvm::CallLowering::handleAssignments().

◆ assignValueToAddress() [1/2]

virtual void llvm::CallLowering::ValueHandler::assignValueToAddress ( const ArgInfo Arg,
unsigned  ValRegIndex,
Register  Addr,
LLT  MemTy,
MachinePointerInfo MPO,
CCValAssign VA 
)
inlinevirtual

An overload which takes an ArgInfo if additional information about the arg is needed.

ValRegIndex is the index in Arg.Regs for the value to store.

Definition at line 277 of file CallLowering.h.

References Addr, Arg, and assignValueToAddress().

◆ assignValueToAddress() [2/2]

virtual void llvm::CallLowering::ValueHandler::assignValueToAddress ( Register  ValVReg,
Register  Addr,
LLT  MemTy,
MachinePointerInfo MPO,
CCValAssign VA 
)
pure virtual

The specified value has been assigned to a stack location.

Load or store it there, with appropriate extension if necessary.

Implemented in OutgoingArgHandler.

Referenced by assignValueToAddress(), and llvm::CallLowering::handleAssignments().

◆ assignValueToReg()

virtual void llvm::CallLowering::ValueHandler::assignValueToReg ( Register  ValVReg,
Register  PhysReg,
CCValAssign  VA 
)
pure virtual

The specified value has been assigned to a physical register, handle the appropriate COPY (either to or from) and mark any relevant uses/defines as needed.

Implemented in llvm::CallLowering::IncomingValueHandler, and OutgoingArgHandler.

Referenced by llvm::CallLowering::handleAssignments().

◆ copyArgumentMemory()

void CallLowering::ValueHandler::copyArgumentMemory ( const ArgInfo Arg,
Register  DstPtr,
Register  SrcPtr,
const MachinePointerInfo DstPtrInfo,
Align  DstAlign,
const MachinePointerInfo SrcPtrInfo,
Align  SrcAlign,
uint64_t  MemSize,
CCValAssign VA 
) const

◆ extendRegister()

Register CallLowering::ValueHandler::extendRegister ( Register  ValReg,
CCValAssign VA,
unsigned  MaxSizeBits = 0 
)

◆ getStackAddress()

virtual Register llvm::CallLowering::ValueHandler::getStackAddress ( uint64_t  MemSize,
int64_t  Offset,
MachinePointerInfo MPO,
ISD::ArgFlagsTy  Flags 
)
pure virtual

Materialize a VReg containing the address of the specified stack-based object.

This is either based on a FrameIndex or direct SP manipulation, depending on the context. MPO should be initialized to an appropriate description of the address created.

Implemented in OutgoingArgHandler.

Referenced by llvm::CallLowering::handleAssignments().

◆ getStackValueStoreType()

LLT CallLowering::ValueHandler::getStackValueStoreType ( const DataLayout DL,
const CCValAssign VA,
ISD::ArgFlagsTy  Flags 
) const
virtual

Return the in-memory size to write for the argument at VA.

This may be smaller than the allocated stack slot size.

This is overridable primarily for targets to maintain compatibility with hacks around the existing DAG call lowering infrastructure.

Definition at line 1046 of file CallLowering.cpp.

References DL, llvm::LLT::getElementCount(), llvm::ISD::ArgFlagsTy::getPointerAddrSpace(), llvm::LLT::getScalarSizeInBits(), llvm::CCValAssign::getValVT(), llvm::MVT::iPTR, llvm::ISD::ArgFlagsTy::isPointer(), llvm::MVT::isVector(), llvm::LLT::pointer(), and llvm::LLT::vector().

Referenced by llvm::CallLowering::handleAssignments().

◆ isIncomingArgumentHandler()

bool llvm::CallLowering::ValueHandler::isIncomingArgumentHandler ( ) const
inline

Returns true if the handler is dealing with incoming arguments, i.e.

those that move values from some physical location to vregs.

Definition at line 239 of file CallLowering.h.

References IsIncomingArgumentHandler.

Referenced by llvm::CallLowering::handleAssignments().

Member Data Documentation

◆ IsIncomingArgumentHandler

const bool llvm::CallLowering::ValueHandler::IsIncomingArgumentHandler

Definition at line 228 of file CallLowering.h.

Referenced by isIncomingArgumentHandler().

◆ MIRBuilder

MachineIRBuilder& llvm::CallLowering::ValueHandler::MIRBuilder

Definition at line 226 of file CallLowering.h.

◆ MRI

MachineRegisterInfo& llvm::CallLowering::ValueHandler::MRI

Definition at line 227 of file CallLowering.h.


The documentation for this struct was generated from the following files: