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

Argument handling is mostly uniform between the four places that make these decisions: function formal arguments, call instruction args, call instruction returns and function returns. More...

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

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

Public Member Functions

 ValueHandler (MachineIRBuilder &MIRBuilder, MachineRegisterInfo &MRI, CCAssignFn *AssignFn)
 
virtual ~ValueHandler ()=default
 
virtual bool isIncomingArgumentHandler () const =0
 Returns true if the handler is dealing with incoming arguments, i.e. More...
 
virtual Register getStackAddress (uint64_t Size, int64_t Offset, MachinePointerInfo &MPO)=0
 Materialize a VReg containing the address of the specified stack-based object. 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, uint64_t Size, MachinePointerInfo &MPO, CCValAssign &VA)=0
 The specified value has been assigned to a stack location. More...
 
virtual unsigned assignCustomValue (const ArgInfo &Arg, ArrayRef< CCValAssign > VAs)
 Handle custom values, which may be passed into one or more of VAs. More...
 
Register extendRegister (Register ValReg, CCValAssign &VA)
 
virtual bool assignArg (unsigned ValNo, MVT ValVT, MVT LocVT, CCValAssign::LocInfo LocInfo, const ArgInfo &Info, ISD::ArgFlagsTy Flags, CCState &State)
 

Public Attributes

MachineIRBuilderMIRBuilder
 
MachineRegisterInfoMRI
 
CCAssignFnAssignFn
 

Detailed Description

Argument handling is mostly uniform between the four places that make these decisions: function formal arguments, call instruction args, call instruction returns and function returns.

However, once a decision has been made on where an arugment should go, exactly what happens can vary slightly. This class abstracts the differences.

Definition at line 112 of file CallLowering.h.

Constructor & Destructor Documentation

◆ ValueHandler()

llvm::CallLowering::ValueHandler::ValueHandler ( MachineIRBuilder MIRBuilder,
MachineRegisterInfo MRI,
CCAssignFn AssignFn 
)
inline

Definition at line 113 of file CallLowering.h.

References Size.

◆ ~ValueHandler()

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

Member Function Documentation

◆ assignArg()

virtual bool llvm::CallLowering::ValueHandler::assignArg ( unsigned  ValNo,
MVT  ValVT,
MVT  LocVT,
CCValAssign::LocInfo  LocInfo,
const ArgInfo Info,
ISD::ArgFlagsTy  Flags,
CCState State 
)
inlinevirtual

Definition at line 157 of file CallLowering.h.

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

◆ assignCustomValue()

virtual unsigned llvm::CallLowering::ValueHandler::assignCustomValue ( const ArgInfo Arg,
ArrayRef< CCValAssign VAs 
)
inlinevirtual

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

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 148 of file CallLowering.h.

References llvm_unreachable.

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

◆ assignValueToAddress()

virtual void llvm::CallLowering::ValueHandler::assignValueToAddress ( Register  ValVReg,
Register  Addr,
uint64_t  Size,
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.

Referenced by 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.

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

◆ extendRegister()

Register CallLowering::ValueHandler::extendRegister ( Register  ValReg,
CCValAssign VA 
)

◆ getStackAddress()

virtual Register llvm::CallLowering::ValueHandler::getStackAddress ( uint64_t  Size,
int64_t  Offset,
MachinePointerInfo MPO 
)
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.

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

◆ isIncomingArgumentHandler()

virtual bool llvm::CallLowering::ValueHandler::isIncomingArgumentHandler ( ) const
pure virtual

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

those that move values from some physical location to vregs.

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

Member Data Documentation

◆ AssignFn

CCAssignFn* llvm::CallLowering::ValueHandler::AssignFn

Definition at line 165 of file CallLowering.h.

◆ MIRBuilder

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

Definition at line 163 of file CallLowering.h.

◆ MRI

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

Definition at line 164 of file CallLowering.h.


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