LLVM 20.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]

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.
 
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.
 
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.
 
virtual void assignValueToReg (Register ValVReg, Register PhysReg, const 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.
 
virtual void assignValueToAddress (Register ValVReg, Register Addr, LLT MemTy, const MachinePointerInfo &MPO, const CCValAssign &VA)=0
 The specified value has been assigned to a stack location.
 
virtual void assignValueToAddress (const ArgInfo &Arg, unsigned ValRegIndex, Register Addr, LLT MemTy, const MachinePointerInfo &MPO, const CCValAssign &VA)
 An overload which takes an ArgInfo if additional information about the arg is needed.
 
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.
 
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.
 
Register extendRegister (Register ValReg, const CCValAssign &VA, unsigned MaxSizeBits=0)
 Extend a register to the location type given in VA, capped at extending to at most MaxSize bits.
 

Public Attributes

MachineIRBuilderMIRBuilder
 
MachineRegisterInfoMRI
 
const bool IsIncomingArgumentHandler
 

Detailed Description

Definition at line 242 of file CallLowering.h.

Constructor & Destructor Documentation

◆ ValueHandler()

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

Definition at line 247 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 including the first one, and which should therefore be skipped from further processing.

Definition at line 308 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,
const MachinePointerInfo MPO,
const 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 294 of file CallLowering.h.

References Addr, assignValueToAddress(), and llvm::CallLowering::ArgInfo::Regs.

◆ assignValueToAddress() [2/2]

virtual void llvm::CallLowering::ValueHandler::assignValueToAddress ( Register  ValVReg,
Register  Addr,
LLT  MemTy,
const MachinePointerInfo MPO,
const 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 M68kOutgoingArgHandler.

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

◆ assignValueToReg()

virtual void llvm::CallLowering::ValueHandler::assignValueToReg ( Register  ValVReg,
Register  PhysReg,
const 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 M68kOutgoingArgHandler.

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,
const 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 M68kOutgoingArgHandler.

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 1246 of file CallLowering.cpp.

References DL, llvm::LLT::getElementCount(), llvm::LLT::getScalarSizeInBits(), llvm::CCValAssign::getValVT(), 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 256 of file CallLowering.h.

References IsIncomingArgumentHandler.

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

Member Data Documentation

◆ IsIncomingArgumentHandler

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

Definition at line 245 of file CallLowering.h.

Referenced by isIncomingArgumentHandler().

◆ MIRBuilder

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

Definition at line 243 of file CallLowering.h.

◆ MRI

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

Definition at line 244 of file CallLowering.h.


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