LLVM 22.0.0git
llvm::CallLowering::ValueHandler Struct Referenceabstract

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

Inheritance diagram for llvm::CallLowering::ValueHandler:
[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 240 of file CallLowering.h.

Constructor & Destructor Documentation

◆ ValueHandler()

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

◆ ~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 306 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 292 of file CallLowering.h.

References 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

Do a memory copy of MemSize bytes from SrcPtr to DstPtr.

This is necessary for outgoing stack-passed byval arguments.

Definition at line 1271 of file CallLowering.cpp.

References llvm::MachineFunction::getMachineMemOperand(), llvm::LLT::getSizeInBits(), MIRBuilder, llvm::MachineMemOperand::MODereferenceable, llvm::MachineMemOperand::MOLoad, llvm::MachineMemOperand::MOStore, MRI, and llvm::LLT::scalar().

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

◆ 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.

References DL, getStackValueStoreType(), and llvm::Offset.

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

References DL, llvm::CCValAssign::getValVT(), llvm::MVT::getVectorNumElements(), llvm::MVT::isVector(), llvm::LLT::pointer(), and llvm::LLT::vector().

Referenced by getStackAddress(), and 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 254 of file CallLowering.h.

References IsIncomingArgumentHandler.

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

Member Data Documentation

◆ IsIncomingArgumentHandler

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

Definition at line 243 of file CallLowering.h.

Referenced by isIncomingArgumentHandler(), and ValueHandler().

◆ MIRBuilder

◆ MRI


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