LLVM  10.0.0svn
Public Member Functions | List of all members
llvm::AArch64CallLowering Class Reference

#include "Target/AArch64/AArch64CallLowering.h"

Inheritance diagram for llvm::AArch64CallLowering:
Inheritance graph
[legend]
Collaboration diagram for llvm::AArch64CallLowering:
Collaboration graph
[legend]

Public Member Functions

 AArch64CallLowering (const AArch64TargetLowering &TLI)
 
bool lowerReturn (MachineIRBuilder &MIRBuilder, const Value *Val, ArrayRef< Register > VRegs, Register SwiftErrorVReg) const override
 This hook must be implemented to lower outgoing return values, described by Val, into the specified virtual registers VRegs. More...
 
bool lowerFormalArguments (MachineIRBuilder &MIRBuilder, const Function &F, ArrayRef< ArrayRef< Register >> VRegs) const override
 This hook must be implemented to lower the incoming (formal) arguments, described by VRegs, for GlobalISel. More...
 
bool lowerCall (MachineIRBuilder &MIRBuilder, CallLoweringInfo &Info) const override
 This hook must be implemented to lower the given call instruction, including argument and return value marshalling. More...
 
bool isEligibleForTailCallOptimization (MachineIRBuilder &MIRBuilder, CallLoweringInfo &Info, SmallVectorImpl< ArgInfo > &InArgs, SmallVectorImpl< ArgInfo > &OutArgs) const
 Returns true if the call can be lowered as a tail call. More...
 
bool supportSwiftError () const override
 
- Public Member Functions inherited from llvm::CallLowering
 CallLowering (const TargetLowering *TLI)
 
virtual ~CallLowering ()=default
 
virtual bool lowerReturn (MachineIRBuilder &MIRBuilder, const Value *Val, ArrayRef< Register > VRegs) const
 This hook behaves as the extended lowerReturn function, but for targets that do not support swifterror value promotion. More...
 
bool lowerCall (MachineIRBuilder &MIRBuilder, ImmutableCallSite CS, ArrayRef< Register > ResRegs, ArrayRef< ArrayRef< Register >> ArgRegs, Register SwiftErrorVReg, std::function< unsigned()> GetCalleeReg) const
 Lower the given call instruction, including argument and return value marshalling. More...
 

Additional Inherited Members

- Protected Member Functions inherited from llvm::CallLowering
const TargetLoweringgetTLI () const
 Getter for generic TargetLowering class. More...
 
template<class XXXTargetLowering >
const XXXTargetLowering * getTLI () const
 Getter for target specific TargetLowering class. More...
 
template<typename FuncInfoTy >
void setArgFlags (ArgInfo &Arg, unsigned OpIdx, const DataLayout &DL, const FuncInfoTy &FuncInfo) const
 
Register packRegs (ArrayRef< Register > SrcRegs, Type *PackedTy, MachineIRBuilder &MIRBuilder) const
 Generate instructions for packing SrcRegs into one big register corresponding to the aggregate type PackedTy. More...
 
void unpackRegs (ArrayRef< Register > DstRegs, Register SrcReg, Type *PackedTy, MachineIRBuilder &MIRBuilder) const
 Generate instructions for unpacking SrcReg into the DstRegs corresponding to the aggregate type PackedTy. More...
 
bool handleAssignments (MachineIRBuilder &MIRBuilder, SmallVectorImpl< ArgInfo > &Args, ValueHandler &Handler) const
 Invoke Handler::assignArg on each of the given Args and then use Callback to move them to the assigned locations. More...
 
bool handleAssignments (CCState &CCState, SmallVectorImpl< CCValAssign > &ArgLocs, MachineIRBuilder &MIRBuilder, SmallVectorImpl< ArgInfo > &Args, ValueHandler &Handler) const
 
bool analyzeArgInfo (CCState &CCState, SmallVectorImpl< ArgInfo > &Args, CCAssignFn &AssignFnFixed, CCAssignFn &AssignFnVarArg) const
 Analyze passed or returned values from a call, supplied in ArgInfo, incorporating info about the passed values into CCState. More...
 
bool resultsCompatible (CallLoweringInfo &Info, MachineFunction &MF, SmallVectorImpl< ArgInfo > &InArgs, CCAssignFn &CalleeAssignFnFixed, CCAssignFn &CalleeAssignFnVarArg, CCAssignFn &CallerAssignFnFixed, CCAssignFn &CallerAssignFnVarArg) const
 

Detailed Description

Definition at line 32 of file AArch64CallLowering.h.

Constructor & Destructor Documentation

◆ AArch64CallLowering()

AArch64CallLowering::AArch64CallLowering ( const AArch64TargetLowering TLI)

Member Function Documentation

◆ isEligibleForTailCallOptimization()

bool AArch64CallLowering::isEligibleForTailCallOptimization ( MachineIRBuilder MIRBuilder,
CallLoweringInfo Info,
SmallVectorImpl< ArgInfo > &  InArgs,
SmallVectorImpl< ArgInfo > &  OutArgs 
) const

◆ lowerCall()

bool AArch64CallLowering::lowerCall ( MachineIRBuilder MIRBuilder,
CallLoweringInfo Info 
) const
overridevirtual

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 from llvm::CallLowering.

Definition at line 921 of file AArch64CallLowering.cpp.

References llvm::MachineInstrBuilder::add(), llvm::MachineInstrBuilder::addImm(), llvm::alignTo(), llvm::MachineIRBuilder::buildCopy(), llvm::MachineIRBuilder::buildInstr(), llvm::MachineIRBuilder::buildInstrNoInsert(), llvm::CallLowering::CallLoweringInfo::CallConv, llvm::CallLowering::CallLoweringInfo::Callee, llvm::AArch64TargetLowering::CCAssignFnForReturn(), llvm::constrainOperandRegClass(), llvm::dbgs(), doesCalleeRestoreStack(), F(), getAssignFnsForCC(), llvm::Function::getCallingConv(), getCallOpcode(), llvm::Module::getDataLayout(), llvm::MachineFunction::getFunction(), llvm::TargetSubtargetInfo::getInstrInfo(), llvm::MachineIRBuilder::getMF(), llvm::MachineInstr::getOperand(), llvm::GlobalValue::getParent(), llvm::TargetSubtargetInfo::getRegBankInfo(), llvm::MachineFunction::getRegInfo(), llvm::MachineFunction::getSubtarget(), llvm::MachineFunction::getTarget(), llvm::TargetOptions::GuaranteedTailCallOpt, llvm::CallLowering::handleAssignments(), llvm::AArch64Subtarget::hasCustomCallingConv(), llvm::RegState::Implicit, llvm::MachineIRBuilder::insertInstr(), isEligibleForTailCallOptimization(), llvm::CallLowering::CallLoweringInfo::IsMustTailCall, llvm::MachineOperand::isReg(), llvm::Type::isVoidTy(), LLVM_DEBUG, llvm::BitmaskEnumDetail::Mask(), llvm::TargetMachine::Options, llvm::CallLowering::CallLoweringInfo::OrigArgs, llvm::CallLowering::CallLoweringInfo::OrigRet, llvm::MachineOperand::setReg(), llvm::CallLowering::CallLoweringInfo::SwiftErrorVReg, TRI, and llvm::CallLowering::ArgInfo::Ty.

◆ lowerFormalArguments()

bool AArch64CallLowering::lowerFormalArguments ( MachineIRBuilder MIRBuilder,
const Function F,
ArrayRef< ArrayRef< Register >>  VRegs 
) const
overridevirtual

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.

Returns
True if the lowering succeeded, false otherwise.

Reimplemented from llvm::CallLowering.

Definition at line 416 of file AArch64CallLowering.cpp.

References llvm::alignTo(), Arg, llvm::Function::args(), llvm::MachineBasicBlock::begin(), llvm::AArch64TargetLowering::CCAssignFnForCall(), doesCalleeRestoreStack(), llvm::MachineBasicBlock::empty(), llvm::AttributeList::FirstArgIndex, llvm::Function::getCallingConv(), llvm::Module::getDataLayout(), llvm::MachineFunction::getFrameInfo(), llvm::MachineFunction::getInfo(), llvm::MachineIRBuilder::getMBB(), llvm::MachineIRBuilder::getMF(), llvm::GlobalValue::getParent(), llvm::MachineFunction::getRegInfo(), llvm::AArch64Subtarget::getRegisterInfo(), llvm::MachineFunction::getSubtarget(), llvm::MachineFunction::getTarget(), llvm::DataLayout::getTypeStoreSize(), llvm::TargetOptions::GuaranteedTailCallOpt, llvm::CallLowering::handleAssignments(), handleMustTailForwardedRegisters(), llvm::Function::isVarArg(), llvm::TargetMachine::Options, llvm::CallLowering::setArgFlags(), llvm::AArch64FunctionInfo::setArgumentStackToRestore(), llvm::AArch64FunctionInfo::setBytesInStackArgArea(), llvm::MachineIRBuilder::setInstr(), llvm::MachineIRBuilder::setMBB(), llvm::AArch64FunctionInfo::setVarArgsStackIndex(), and llvm::AArch64RegisterInfo::UpdateCustomCalleeSavedRegs().

◆ lowerReturn()

bool AArch64CallLowering::lowerReturn ( MachineIRBuilder MIRBuilder,
const Value Val,
ArrayRef< Register VRegs,
Register  SwiftErrorVReg 
) const
overridevirtual

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.

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 from llvm::CallLowering.

Definition at line 256 of file AArch64CallLowering.cpp.

References assert(), llvm::MachineIRBuilder::buildBuildVector(), llvm::MachineIRBuilder::buildCopy(), llvm::MachineIRBuilder::buildInstr(), llvm::MachineIRBuilder::buildInstrNoInsert(), llvm::MachineIRBuilder::buildMerge(), llvm::MachineIRBuilder::buildUndef(), llvm::MachineIRBuilder::buildZExt(), llvm::AArch64TargetLowering::CCAssignFnForReturn(), llvm::ComputeValueVTs(), llvm::dbgs(), llvm::ArrayRef< T >::empty(), F(), llvm::Function::getAttributes(), llvm::Function::getCallingConv(), llvm::Type::getContext(), llvm::Module::getDataLayout(), llvm::MachineFunction::getFunction(), llvm::MachineIRBuilder::getMF(), llvm::LLT::getNumElements(), llvm::TargetLoweringBase::getNumRegistersForCallingConv(), llvm::GlobalValue::getParent(), llvm::MachineInstrBuilder::getReg(), getReg(), llvm::MachineFunction::getRegInfo(), llvm::TargetLoweringBase::getRegisterTypeForCallingConv(), llvm::LLT::getSizeInBits(), llvm::Value::getType(), llvm::MachineRegisterInfo::getType(), llvm::EVT::getTypeForEVT(), llvm::MVT::getVT(), llvm::CallLowering::handleAssignments(), llvm::AttributeList::hasAttribute(), llvm::RegState::Implicit, llvm::MachineIRBuilder::insertInstr(), llvm::LLT::isVector(), llvm::MVT::isVector(), LLVM_DEBUG, llvm::CallLowering::ArgInfo::Regs, llvm::AttributeList::ReturnIndex, llvm::LLT::scalar(), llvm::CallLowering::setArgFlags(), llvm::SmallVectorBase::size(), llvm::ArrayRef< T >::size(), Success, llvm::CallLowering::ArgInfo::Ty, and llvm::RegState::Undef.

◆ supportSwiftError()

bool llvm::AArch64CallLowering::supportSwiftError ( ) const
inlineoverridevirtual
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 from llvm::CallLowering.

Definition at line 53 of file AArch64CallLowering.h.

References function, and MRI.


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