Thanks to visit codestin.com
Credit goes to llvm.org

LLVM 22.0.0git
llvm::CallLowering Class Reference

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

Inheritance diagram for llvm::CallLowering:
[legend]

Classes

struct  ArgInfo
struct  BaseArgInfo
struct  CallLoweringInfo
struct  IncomingValueAssigner
struct  IncomingValueHandler
 Base class for ValueHandlers used for arguments coming into the current function, or for return values received from a call. More...
struct  OutgoingValueAssigner
struct  OutgoingValueHandler
 Base class for ValueHandlers used for arguments passed to a function call, or for return values. More...
struct  PtrAuthInfo
struct  ValueAssigner
 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...
struct  ValueHandler

Public Member Functions

 CallLowering (const TargetLowering *TLI)
virtual ~CallLowering ()=default
virtual bool supportSwiftError () const
void insertSRetLoads (MachineIRBuilder &MIRBuilder, Type *RetTy, ArrayRef< Register > VRegs, Register DemoteReg, int FI) const
 Load the returned value from the stack into virtual registers in VRegs.
void insertSRetStores (MachineIRBuilder &MIRBuilder, Type *RetTy, ArrayRef< Register > VRegs, Register DemoteReg) const
 Store the return value given by VRegs into stack starting at the offset specified in DemoteReg.
void insertSRetIncomingArgument (const Function &F, SmallVectorImpl< ArgInfo > &SplitArgs, Register &DemoteReg, MachineRegisterInfo &MRI, const DataLayout &DL) const
 Insert the hidden sret ArgInfo to the beginning of SplitArgs.
void insertSRetOutgoingArgument (MachineIRBuilder &MIRBuilder, const CallBase &CB, CallLoweringInfo &Info) const
 For the call-base described by CB, insert the hidden sret ArgInfo to the OrigArgs field of Info.
bool checkReturn (CCState &CCInfo, SmallVectorImpl< BaseArgInfo > &Outs, CCAssignFn *Fn) const
void getReturnInfo (CallingConv::ID CallConv, Type *RetTy, AttributeList Attrs, SmallVectorImpl< BaseArgInfo > &Outs, const DataLayout &DL) const
 Get the type and the ArgFlags for the split components of RetTy as returned by ComputeValueVTs.
bool checkReturnTypeForCallConv (MachineFunction &MF) const
 Toplevel function to check the return type based on the target calling convention.
virtual bool canLowerReturn (MachineFunction &MF, CallingConv::ID CallConv, SmallVectorImpl< BaseArgInfo > &Outs, bool IsVarArg) const
 This hook must be implemented to check whether the return values described by Outs can fit into the return registers.
virtual bool lowerReturn (MachineIRBuilder &MIRBuilder, const Value *Val, ArrayRef< Register > VRegs, FunctionLoweringInfo &FLI, Register SwiftErrorVReg) const
 This hook must be implemented to lower outgoing return values, described by Val, into the specified virtual registers VRegs.
virtual bool lowerReturn (MachineIRBuilder &MIRBuilder, const Value *Val, ArrayRef< Register > VRegs, FunctionLoweringInfo &FLI) const
 This hook behaves as the extended lowerReturn function, but for targets that do not support swifterror value promotion.
virtual bool fallBackToDAGISel (const MachineFunction &MF) const
virtual bool lowerFormalArguments (MachineIRBuilder &MIRBuilder, const Function &F, ArrayRef< ArrayRef< Register > > VRegs, FunctionLoweringInfo &FLI) const
 This hook must be implemented to lower the incoming (formal) arguments, described by VRegs, for GlobalISel.
virtual bool lowerCall (MachineIRBuilder &MIRBuilder, CallLoweringInfo &Info) const
 This hook must be implemented to lower the given call instruction, including argument and return value marshalling.
bool lowerCall (MachineIRBuilder &MIRBuilder, const CallBase &Call, ArrayRef< Register > ResRegs, ArrayRef< ArrayRef< Register > > ArgRegs, Register SwiftErrorVReg, std::optional< PtrAuthInfo > PAI, Register ConvergenceCtrlToken, std::function< Register()> GetCalleeReg) const
 Lower the given call instruction, including argument and return value marshalling.
virtual bool enableBigEndian () const
 For targets which want to use big-endian can enable it with enableBigEndian() hook.
virtual bool isTypeIsValidForThisReturn (EVT Ty) const
 For targets which support the "returned" parameter attribute, returns true if the given type is a valid one to use with "returned".

Protected Member Functions

const TargetLoweringgetTLI () const
 Getter for generic TargetLowering class.
template<class XXXTargetLowering>
const XXXTargetLowering * getTLI () const
 Getter for target specific TargetLowering class.
ISD::ArgFlagsTy getAttributesForArgIdx (const CallBase &Call, unsigned ArgIdx) const
ISD::ArgFlagsTy getAttributesForReturn (const CallBase &Call) const
void addArgFlagsFromAttributes (ISD::ArgFlagsTy &Flags, const AttributeList &Attrs, unsigned OpIdx) const
 Adds flags to Flags based off of the attributes in Attrs.
template<typename FuncInfoTy>
void setArgFlags (ArgInfo &Arg, unsigned OpIdx, const DataLayout &DL, const FuncInfoTy &FuncInfo) const
void splitToValueTypes (const ArgInfo &OrigArgInfo, SmallVectorImpl< ArgInfo > &SplitArgs, const DataLayout &DL, CallingConv::ID CallConv, SmallVectorImpl< uint64_t > *Offsets=nullptr) const
 Break OrigArgInfo into one or more pieces the calling convention can process, returned in SplitArgs.
bool determineAssignments (ValueAssigner &Assigner, SmallVectorImpl< ArgInfo > &Args, CCState &CCInfo) const
 Analyze the argument list in Args, using Assigner to populate CCInfo.
bool determineAndHandleAssignments (ValueHandler &Handler, ValueAssigner &Assigner, SmallVectorImpl< ArgInfo > &Args, MachineIRBuilder &MIRBuilder, CallingConv::ID CallConv, bool IsVarArg, ArrayRef< Register > ThisReturnRegs={}) const
 Invoke ValueAssigner::assignArg on each of the given Args and then use Handler to move them to the assigned locations.
bool handleAssignments (ValueHandler &Handler, SmallVectorImpl< ArgInfo > &Args, CCState &CCState, SmallVectorImpl< CCValAssign > &ArgLocs, MachineIRBuilder &MIRBuilder, ArrayRef< Register > ThisReturnRegs={}) const
 Use Handler to insert code to handle the argument/return values represented by Args.
bool parametersInCSRMatch (const MachineRegisterInfo &MRI, const uint32_t *CallerPreservedMask, const SmallVectorImpl< CCValAssign > &ArgLocs, const SmallVectorImpl< ArgInfo > &OutVals) const
 Check whether parameters to a call that are passed in callee saved registers are the same as from the calling function.
bool resultsCompatible (CallLoweringInfo &Info, MachineFunction &MF, SmallVectorImpl< ArgInfo > &InArgs, ValueAssigner &CalleeAssigner, ValueAssigner &CallerAssigner) const

Detailed Description

Definition at line 45 of file CallLowering.h.

Constructor & Destructor Documentation

◆ CallLowering()

◆ ~CallLowering()

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

Member Function Documentation

◆ addArgFlagsFromAttributes()

void CallLowering::addArgFlagsFromAttributes ( ISD::ArgFlagsTy & Flags,
const AttributeList & Attrs,
unsigned OpIdx ) const
protected

Adds flags to Flags based off of the attributes in Attrs.

OpIdx is the index in Attrs to add flags from.

Definition at line 85 of file CallLowering.cpp.

References addFlagsUsingAttrFn(), and OpIdx.

Referenced by getReturnInfo(), and setArgFlags().

◆ canLowerReturn()

virtual bool llvm::CallLowering::canLowerReturn ( MachineFunction & MF,
CallingConv::ID CallConv,
SmallVectorImpl< BaseArgInfo > & Outs,
bool IsVarArg ) const
inlinevirtual

This hook must be implemented to check whether the return values described by Outs can fit into the return registers.

If false is returned, an sret-demotion is performed.

Reimplemented in llvm::AArch64CallLowering, llvm::RISCVCallLowering, and llvm::X86CallLowering.

Definition at line 505 of file CallLowering.h.

Referenced by checkReturnTypeForCallConv(), and lowerCall().

◆ checkReturn()

bool CallLowering::checkReturn ( CCState & CCInfo,
SmallVectorImpl< BaseArgInfo > & Outs,
CCAssignFn * Fn ) const
Returns
True if the return type described by Outs can be returned without performing sret demotion.

Definition at line 1097 of file CallLowering.cpp.

References llvm::CCValAssign::Full, llvm::MVT::getVT(), I, and llvm::SmallVectorTemplateCommon< T, typename >::size().

Referenced by llvm::AArch64CallLowering::canLowerReturn(), and llvm::X86CallLowering::canLowerReturn().

◆ checkReturnTypeForCallConv()

bool CallLowering::checkReturnTypeForCallConv ( MachineFunction & MF) const

Toplevel function to check the return type based on the target calling convention.

Returns
True if the return value of MF can be returned without performing sret demotion.

Definition at line 1131 of file CallLowering.cpp.

References canLowerReturn(), F, llvm::MachineFunction::getDataLayout(), llvm::MachineFunction::getFunction(), and getReturnInfo().

◆ determineAndHandleAssignments()

◆ determineAssignments()

bool CallLowering::determineAssignments ( ValueAssigner & Assigner,
SmallVectorImpl< ArgInfo > & Args,
CCState & CCInfo ) const
protected

Analyze the argument list in Args, using Assigner to populate CCInfo.

This will determine the types and locations to use for passed or returned values. This may resize fields in Args if the value is split across multiple registers or stack slots.

This is independent of the function state and can be used to determine how a call would pass arguments without needing to change the function. This can be used to check if arguments are suitable for tail call lowering.

Returns
True if everything has succeeded, false otherwise.

Definition at line 674 of file CallLowering.cpp.

References llvm::CallLowering::ValueAssigner::assignArg(), llvm::CCValAssign::Full, llvm::CCState::getCallingConv(), llvm::CCState::getContext(), and llvm::EVT::getEVT().

Referenced by llvm::AMDGPUCallLowering::areCalleeOutgoingArgsTailCallable(), determineAndHandleAssignments(), llvm::AMDGPUCallLowering::lowerCall(), llvm::MipsCallLowering::lowerCall(), llvm::AArch64CallLowering::lowerFormalArguments(), llvm::AMDGPUCallLowering::lowerFormalArguments(), llvm::MipsCallLowering::lowerFormalArguments(), llvm::RISCVCallLowering::lowerFormalArguments(), llvm::MipsCallLowering::lowerReturn(), llvm::AMDGPUCallLowering::lowerTailCall(), and resultsCompatible().

◆ enableBigEndian()

virtual bool llvm::CallLowering::enableBigEndian ( ) const
inlinevirtual

For targets which want to use big-endian can enable it with enableBigEndian() hook.

Reimplemented in llvm::ARMCallLowering, and llvm::M68kCallLowering.

Definition at line 602 of file CallLowering.h.

◆ fallBackToDAGISel()

virtual bool llvm::CallLowering::fallBackToDAGISel ( const MachineFunction & MF) const
inlinevirtual

Reimplemented in llvm::AArch64CallLowering.

Definition at line 539 of file CallLowering.h.

◆ getAttributesForArgIdx()

ISD::ArgFlagsTy CallLowering::getAttributesForArgIdx ( const CallBase & Call,
unsigned ArgIdx ) const
protected
Returns
Flags corresponding to the attributes on the ArgIdx-th parameter of Call.

Definition at line 67 of file CallLowering.cpp.

References addFlagsUsingAttrFn(), and Call.

Referenced by lowerCall().

◆ getAttributesForReturn()

ISD::ArgFlagsTy CallLowering::getAttributesForReturn ( const CallBase & Call) const
protected
Returns
Flags corresponding to the attributes on the return from Call.

Definition at line 77 of file CallLowering.cpp.

References addFlagsUsingAttrFn(), and Call.

Referenced by lowerCall().

◆ getReturnInfo()

void CallLowering::getReturnInfo ( CallingConv::ID CallConv,
Type * RetTy,
AttributeList Attrs,
SmallVectorImpl< BaseArgInfo > & Outs,
const DataLayout & DL ) const

Get the type and the ArgFlags for the split components of RetTy as returned by ComputeValueVTs.

Definition at line 1108 of file CallLowering.cpp.

References addArgFlagsFromAttributes(), llvm::ComputeValueVTs(), DL, llvm::SmallVectorImpl< T >::emplace_back(), llvm::Type::getContext(), llvm::EVT::getTypeForEVT(), and I.

Referenced by checkReturnTypeForCallConv(), and lowerCall().

◆ getTLI() [1/2]

◆ getTLI() [2/2]

template<class XXXTargetLowering>
const XXXTargetLowering * llvm::CallLowering::getTLI ( ) const
inlineprotected

Getter for target specific TargetLowering class.

Definition at line 358 of file CallLowering.h.

◆ handleAssignments()

bool CallLowering::handleAssignments ( ValueHandler & Handler,
SmallVectorImpl< ArgInfo > & Args,
CCState & CCState,
SmallVectorImpl< CCValAssign > & ArgLocs,
MachineIRBuilder & MIRBuilder,
ArrayRef< Register > ThisReturnRegs = {} ) const
protected

Use Handler to insert code to handle the argument/return values represented by Args.

It's expected determineAssignments previously processed these arguments to populate CCState and ArgLocs.

Definition at line 735 of file CallLowering.cpp.

References llvm::ArrayRef(), assert(), llvm::CallLowering::ValueHandler::assignCustomValue(), llvm::CallLowering::ValueHandler::assignValueToAddress(), llvm::CallLowering::ValueHandler::assignValueToReg(), llvm::MachineIRBuilder::buildCopy(), buildCopyFromRegs(), buildCopyToRegs(), llvm::MachineIRBuilder::buildFrameIndex(), llvm::MachineIRBuilder::buildLoad(), llvm::MachineIRBuilder::buildStore(), llvm::CallLowering::ValueHandler::copyArgumentMemory(), llvm::MachineFrameInfo::CreateStackObject(), DL, llvm::ArrayRef< T >::empty(), extendOpFromFlags(), F, llvm::LLT::getAddressSpace(), llvm::DataLayout::getAllocaAddrSpace(), llvm::MachineFunction::getDataLayout(), llvm::EVT::getEVT(), llvm::MachinePointerInfo::getFixedStack(), llvm::MachineFunction::getFrameInfo(), llvm::MachineFunction::getFunction(), llvm::getLLTForType(), llvm::CCValAssign::getLocInfo(), llvm::CCValAssign::getLocMemOffset(), llvm::CCValAssign::getLocReg(), llvm::CCValAssign::getLocVT(), llvm::MachineIRBuilder::getMF(), llvm::MachineInstrBuilder::getReg(), llvm::MachineFunction::getRegInfo(), llvm::LLT::getScalarSizeInBits(), llvm::LLT::getSizeInBytes(), llvm::CallLowering::ValueHandler::getStackAddress(), llvm::CallLowering::ValueHandler::getStackValueStoreType(), llvm::MachinePointerInfo::getUnknownStack(), llvm::CCValAssign::getValNo(), llvm::CCValAssign::getValVT(), llvm::CCValAssign::Indirect, llvm::inferAlignFromPtrInfo(), llvm::CallLowering::ValueHandler::isIncomingArgumentHandler(), llvm::CCValAssign::isMemLoc(), isTypeIsValidForThisReturn(), MRI, llvm::CCValAssign::needsCustom(), llvm::Offset, llvm::LLT::pointer(), and llvm::SmallVectorTemplateCommon< T, typename >::size().

Referenced by determineAndHandleAssignments(), llvm::AMDGPUCallLowering::lowerCall(), llvm::MipsCallLowering::lowerCall(), llvm::AArch64CallLowering::lowerFormalArguments(), llvm::AMDGPUCallLowering::lowerFormalArguments(), llvm::MipsCallLowering::lowerFormalArguments(), llvm::RISCVCallLowering::lowerFormalArguments(), llvm::MipsCallLowering::lowerReturn(), and llvm::AMDGPUCallLowering::lowerTailCall().

◆ insertSRetIncomingArgument()

◆ insertSRetLoads()

◆ insertSRetOutgoingArgument()

◆ insertSRetStores()

◆ isTypeIsValidForThisReturn()

virtual bool llvm::CallLowering::isTypeIsValidForThisReturn ( EVT Ty) const
inlinevirtual

For targets which support the "returned" parameter attribute, returns true if the given type is a valid one to use with "returned".

Reimplemented in llvm::AArch64CallLowering.

Definition at line 606 of file CallLowering.h.

Referenced by handleAssignments().

◆ lowerCall() [1/2]

virtual bool llvm::CallLowering::lowerCall ( MachineIRBuilder & MIRBuilder,
CallLoweringInfo & Info ) const
inlinevirtual

This hook must be implemented to lower the given call instruction, including argument and return value marshalling.

Returns
true if the lowering succeeded, false otherwise.

Reimplemented in llvm::AArch64CallLowering, llvm::AMDGPUCallLowering, llvm::ARMCallLowering, llvm::BPFCallLowering, llvm::M68kCallLowering, llvm::MipsCallLowering, llvm::PPCCallLowering, llvm::RISCVCallLowering, llvm::SPIRVCallLowering, and llvm::X86CallLowering.

Definition at line 565 of file CallLowering.h.

References Info.

Referenced by lowerCall().

◆ lowerCall() [2/2]

bool CallLowering::lowerCall ( MachineIRBuilder & MIRBuilder,
const CallBase & Call,
ArrayRef< Register > ResRegs,
ArrayRef< ArrayRef< Register > > ArgRegs,
Register SwiftErrorVReg,
std::optional< PtrAuthInfo > PAI,
Register ConvergenceCtrlToken,
std::function< Register()> GetCalleeReg ) const

Lower the given call instruction, including argument and return value marshalling.

CI is the call/invoke instruction.

ResRegs are the registers where the call's return value should be stored (or 0 if there is no return value). There will be one register for each non-aggregate type, as returned by computeValueLLTs.

ArgRegs is a list of lists of virtual registers containing each argument that needs to be passed (argument i should be placed in ArgRegs[i]). For each argument, there will be one register for each non-aggregate type, as returned by computeValueLLTs.

SwiftErrorVReg is non-zero if the call has a swifterror inout parameter, and contains the vreg that the swifterror should be copied into after the call.

GetCalleeReg is a callback to materialize a register for the callee if the target determines it cannot jump to the destination based purely on CI. This might be because CI is indirect, or because of the limited range of an immediate jump.

Returns
true if the lowering succeeded, false otherwise.

Definition at line 93 of file CallLowering.cpp.

References llvm::CallBase::args(), assert(), llvm::MachineIRBuilder::buildAssertAlign(), llvm::MachineIRBuilder::buildGlobalValue(), canLowerReturn(), llvm::cast(), llvm::CallBase::countOperandBundlesOfType(), llvm::MachineOperand::CreateGA(), llvm::MachineOperand::CreateReg(), DL, llvm::dyn_cast(), F, llvm::CallLowering::BaseArgInfo::Flags, llvm::CallBase::getAttributes(), getAttributesForArgIdx(), getAttributesForReturn(), llvm::CallBase::getCalledOperand(), llvm::CallBase::getCallingConv(), llvm::MachineIRBuilder::getDataLayout(), llvm::MachineFunction::getFunction(), llvm::CallBase::getFunctionType(), llvm::getLLTForType(), llvm::Instruction::getMetadata(), llvm::MachineIRBuilder::getMF(), llvm::FunctionType::getNumParams(), llvm::CallBase::getOperandBundle(), llvm::MachineInstrBuilder::getReg(), llvm::MachineFunction::getRegInfo(), llvm::CallBase::getRetAlign(), getReturnInfo(), llvm::MachineFunction::getTarget(), llvm::Value::getType(), insertSRetOutgoingArgument(), llvm::isa(), llvm::CallBase::isConvergent(), llvm::CallBase::isIndirectCall(), llvm::isInTailCallPosition(), llvm::CallBase::isMustTailCall(), llvm::CallBase::isTailCall(), llvm::FunctionType::isVarArg(), lowerCall(), MRI, llvm::LLVMContext::OB_kcfi, llvm::LLVMContext::OB_ptrauth, setArgFlags(), and llvm::Value::stripPointerCasts().

◆ lowerFormalArguments()

virtual bool llvm::CallLowering::lowerFormalArguments ( MachineIRBuilder & MIRBuilder,
const Function & F,
ArrayRef< ArrayRef< Register > > VRegs,
FunctionLoweringInfo & FLI ) const
inlinevirtual

This hook must be implemented to lower the incoming (formal) arguments, described by VRegs, for GlobalISel.

Each argument must end up in the related virtual registers described by VRegs. In other words, the first argument should end up in VRegs[0], the second in VRegs[1], and so on. For each argument, there will be one register for each non-aggregate type, as returned by computeValueLLTs. MIRBuilder is set to the proper insertion for the argument lowering. FLI is required for sret demotion.

Returns
True if the lowering succeeded, false otherwise.

Reimplemented in llvm::AArch64CallLowering, llvm::AMDGPUCallLowering, llvm::ARMCallLowering, llvm::BPFCallLowering, llvm::M68kCallLowering, llvm::MipsCallLowering, llvm::PPCCallLowering, llvm::RISCVCallLowering, llvm::SPIRVCallLowering, and llvm::X86CallLowering.

Definition at line 553 of file CallLowering.h.

References F.

◆ lowerReturn() [1/2]

virtual bool llvm::CallLowering::lowerReturn ( MachineIRBuilder & MIRBuilder,
const Value * Val,
ArrayRef< Register > VRegs,
FunctionLoweringInfo & FLI ) const
inlinevirtual

This hook behaves as the extended lowerReturn function, but for targets that do not support swifterror value promotion.

Reimplemented in llvm::AMDGPUCallLowering, llvm::ARMCallLowering, llvm::MipsCallLowering, llvm::RISCVCallLowering, and llvm::X86CallLowering.

Definition at line 533 of file CallLowering.h.

◆ lowerReturn() [2/2]

virtual bool llvm::CallLowering::lowerReturn ( MachineIRBuilder & MIRBuilder,
const Value * Val,
ArrayRef< Register > VRegs,
FunctionLoweringInfo & FLI,
Register SwiftErrorVReg ) const
inlinevirtual

This hook must be implemented to lower outgoing return values, described by Val, into the specified virtual registers VRegs.

This hook is used by GlobalISel.

FLI is required for sret demotion.

SwiftErrorVReg is non-zero if the function has a swifterror parameter that needs to be implicitly returned.

Returns
True if the lowering succeeds, false otherwise.

Reimplemented in llvm::AArch64CallLowering, llvm::BPFCallLowering, llvm::M68kCallLowering, llvm::PPCCallLowering, and llvm::SPIRVCallLowering.

Definition at line 521 of file CallLowering.h.

References assert(), lowerReturn(), and supportSwiftError().

Referenced by lowerReturn().

◆ parametersInCSRMatch()

bool CallLowering::parametersInCSRMatch ( const MachineRegisterInfo & MRI,
const uint32_t * CallerPreservedMask,
const SmallVectorImpl< CCValAssign > & ArgLocs,
const SmallVectorImpl< ArgInfo > & OutVals ) const
protected

Check whether parameters to a call that are passed in callee saved registers are the same as from the calling function.

This needs to be checked for tail call eligibility.

Definition at line 1142 of file CallLowering.cpp.

References llvm::MachineOperand::clobbersPhysReg(), llvm::dbgs(), llvm::getDefIgnoringCopies(), llvm::MachineInstr::getOpcode(), llvm::MachineInstr::getOperand(), llvm::MachineOperand::getReg(), LLVM_DEBUG, MRI, llvm::CallLowering::ArgInfo::Regs, and llvm::SmallVectorTemplateCommon< T, typename >::size().

Referenced by llvm::AMDGPUCallLowering::areCalleeOutgoingArgsTailCallable().

◆ resultsCompatible()

bool CallLowering::resultsCompatible ( CallLoweringInfo & Info,
MachineFunction & MF,
SmallVectorImpl< ArgInfo > & InArgs,
ValueAssigner & CalleeAssigner,
ValueAssigner & CallerAssigner ) const
protected
Returns
True if the calling convention for a callee and its caller pass results in the same way. Typically used for tail call eligibility checks.

Info is the CallLoweringInfo for the call. MF is the MachineFunction for the caller. InArgs contains the results of the call. CalleeAssigner specifies the target's handling of the argument types for the callee. CallerAssigner specifies the target's handling of the argument types for the caller.

Definition at line 1194 of file CallLowering.cpp.

References determineAssignments(), F, llvm::MachineFunction::getFunction(), llvm::CCValAssign::getLocMemOffset(), llvm::CCValAssign::getLocReg(), llvm::CCValAssign::isRegLoc(), and llvm::SmallVectorTemplateCommon< T, typename >::size().

Referenced by llvm::AMDGPUCallLowering::doCallerAndCalleePassArgsTheSameWay().

◆ setArgFlags()

◆ splitToValueTypes()

void CallLowering::splitToValueTypes ( const ArgInfo & OrigArgInfo,
SmallVectorImpl< ArgInfo > & SplitArgs,
const DataLayout & DL,
CallingConv::ID CallConv,
SmallVectorImpl< uint64_t > * Offsets = nullptr ) const
protected

Break OrigArgInfo into one or more pieces the calling convention can process, returned in SplitArgs.

For example, this should break structs down into individual fields.

If Offsets is non-null, it points to a vector to be filled in with the in-memory offsets of each of the individual values.

Definition at line 287 of file CallLowering.cpp.

References assert(), llvm::SmallVectorTemplateCommon< T, typename >::back(), llvm::ComputeValueVTs(), DL, llvm::SmallVectorImpl< T >::emplace_back(), llvm::CallLowering::BaseArgInfo::Flags, llvm::Type::getContext(), llvm::CallLowering::ArgInfo::OrigArgIndex, llvm::CallLowering::ArgInfo::OrigValue, llvm::CallLowering::ArgInfo::Regs, llvm::SmallVectorTemplateCommon< T, typename >::size(), and llvm::CallLowering::BaseArgInfo::Ty.

Referenced by llvm::AArch64CallLowering::lowerCall(), llvm::AMDGPUCallLowering::lowerCall(), llvm::ARMCallLowering::lowerCall(), llvm::M68kCallLowering::lowerCall(), llvm::MipsCallLowering::lowerCall(), llvm::RISCVCallLowering::lowerCall(), llvm::X86CallLowering::lowerCall(), llvm::AMDGPUCallLowering::lowerChainCall(), llvm::AArch64CallLowering::lowerFormalArguments(), llvm::AMDGPUCallLowering::lowerFormalArguments(), llvm::ARMCallLowering::lowerFormalArguments(), llvm::M68kCallLowering::lowerFormalArguments(), llvm::MipsCallLowering::lowerFormalArguments(), llvm::PPCCallLowering::lowerFormalArguments(), llvm::RISCVCallLowering::lowerFormalArguments(), llvm::X86CallLowering::lowerFormalArguments(), llvm::AArch64CallLowering::lowerReturn(), llvm::M68kCallLowering::lowerReturn(), llvm::MipsCallLowering::lowerReturn(), llvm::PPCCallLowering::lowerReturn(), llvm::RISCVCallLowering::lowerReturn(), and llvm::X86CallLowering::lowerReturn().

◆ supportSwiftError()

virtual bool llvm::CallLowering::supportSwiftError ( ) const
inlinevirtual
Returns
true if the target is capable of handling swifterror values that have been promoted to a specified register. The extended versions of lowerReturn and lowerCall should be implemented.

Reimplemented in llvm::AArch64CallLowering.

Definition at line 456 of file CallLowering.h.

Referenced by lowerReturn().


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