LLVM 17.0.0git
|
#include "llvm/CodeGen/GlobalISel/CallLowering.h"
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, 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, MachinePointerInfo &MPO, 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, MachinePointerInfo &MPO, 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, 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 | |
MachineIRBuilder & | MIRBuilder |
MachineRegisterInfo & | MRI |
const bool | IsIncomingArgumentHandler |
Definition at line 228 of file CallLowering.h.
|
inline |
Definition at line 233 of file CallLowering.h.
|
virtualdefault |
|
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.
VAs
that have been assigned after the first one, and which should therefore be skipped from further processing. Definition at line 294 of file CallLowering.h.
References llvm_unreachable.
Referenced by llvm::CallLowering::handleAssignments().
|
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 280 of file CallLowering.h.
References Addr, Arg, and assignValueToAddress().
|
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().
|
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().
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 1111 of file CallLowering.cpp.
References llvm::MachineIRBuilder::buildConstant(), llvm::MachineIRBuilder::buildMemCpy(), llvm::MachineFunction::getMachineMemOperand(), llvm::MachineIRBuilder::getMF(), llvm::LLT::getSizeInBits(), llvm::MachineMemOperand::MODereferenceable, llvm::MachineMemOperand::MOLoad, llvm::MachineMemOperand::MOStore, MRI, and llvm::LLT::scalar().
Referenced by llvm::CallLowering::handleAssignments().
Register CallLowering::ValueHandler::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.
If MaxSizeBits is 0 then no maximum is set.
Definition at line 1134 of file CallLowering.cpp.
References llvm::CCValAssign::AExt, llvm::CCValAssign::BCvt, llvm::MachineIRBuilder::buildAnyExt(), llvm::MachineIRBuilder::buildPtrToInt(), llvm::MachineIRBuilder::buildSExt(), llvm::MachineIRBuilder::buildZExt(), llvm::CCValAssign::Full, llvm::CCValAssign::getLocInfo(), llvm::CCValAssign::getLocVT(), llvm::MachineInstrBuilder::getReg(), llvm::LLT::getSizeInBits(), llvm::CCValAssign::getValVT(), llvm::LLT::isPointer(), llvm_unreachable, MRI, llvm::LLT::scalar(), llvm::CCValAssign::SExt, and llvm::CCValAssign::ZExt.
|
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().
|
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 1088 of file CallLowering.cpp.
References DL, Flags, llvm::LLT::getElementCount(), llvm::LLT::getScalarSizeInBits(), llvm::CCValAssign::getValVT(), llvm::MVT::isVector(), llvm::LLT::pointer(), and llvm::LLT::vector().
Referenced by llvm::CallLowering::handleAssignments().
|
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 242 of file CallLowering.h.
References IsIncomingArgumentHandler.
Referenced by llvm::CallLowering::handleAssignments().
Definition at line 231 of file CallLowering.h.
Referenced by isIncomingArgumentHandler().
MachineIRBuilder& llvm::CallLowering::ValueHandler::MIRBuilder |
Definition at line 229 of file CallLowering.h.
MachineRegisterInfo& llvm::CallLowering::ValueHandler::MRI |
Definition at line 230 of file CallLowering.h.