LLVM  8.0.1
Public Member Functions | List of all members
llvm::X86CallLowering Class Reference

#include "Target/X86/X86CallLowering.h"

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

Public Member Functions

 X86CallLowering (const X86TargetLowering &TLI)
 
bool lowerReturn (MachineIRBuilder &MIRBuilder, const Value *Val, ArrayRef< unsigned > VRegs) 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< unsigned > VRegs) const override
 This hook must be implemented to lower the incoming (formal) arguments, described by Args, for GlobalISel. More...
 
bool lowerCall (MachineIRBuilder &MIRBuilder, CallingConv::ID CallConv, const MachineOperand &Callee, const ArgInfo &OrigRet, ArrayRef< ArgInfo > OrigArgs) const override
 This hook must be implemented to lower the given call instruction, including argument and return value marshalling. More...
 
- Public Member Functions inherited from llvm::CallLowering
 CallLowering (const TargetLowering *TLI)
 
virtual ~CallLowering ()=default
 
bool lowerCall (MachineIRBuilder &MIRBuilder, ImmutableCallSite CS, unsigned ResReg, ArrayRef< unsigned > ArgRegs, 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
 
bool handleAssignments (MachineIRBuilder &MIRBuilder, ArrayRef< 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...
 

Detailed Description

Definition at line 28 of file X86CallLowering.h.

Constructor & Destructor Documentation

◆ X86CallLowering()

X86CallLowering::X86CallLowering ( const X86TargetLowering TLI)

Definition at line 53 of file X86CallLowering.cpp.

References llvm::MachineInstrBuilder::addUse(), assert(), llvm::MachineIRBuilder::buildAnyExt(), llvm::MachineIRBuilder::buildConstant(), llvm::MachineIRBuilder::buildCopy(), llvm::MachineIRBuilder::buildGEP(), llvm::MachineIRBuilder::buildStore(), llvm::ComputeValueVTs(), Context, llvm::MachineRegisterInfo::createGenericVirtualRegister(), llvm::SmallVectorImpl< T >::emplace_back(), llvm::CallLowering::ArgInfo::Flags, llvm::Type::getContext(), llvm::MachineFunction::getDataLayout(), llvm::CCState::getFirstUnallocated(), llvm::getLLTForType(), llvm::CCValAssign::getLocVT(), llvm::MachineFunction::getMachineMemOperand(), llvm::MachineIRBuilder::getMF(), llvm::CCState::getNextStackOffset(), llvm::TargetLoweringBase::getNumRegisters(), llvm::MachineInstr::getOperand(), llvm::DataLayout::getPointerSizeInBits(), llvm::MachineOperand::getReg(), llvm::TargetLoweringBase::getRegisterType(), llvm::TargetRegisterInfo::getRegSizeInBits(), llvm::MVT::getSizeInBits(), llvm::MachinePointerInfo::getStack(), llvm::MVT::getStoreSize(), llvm::MachineFunction::getSubtarget(), llvm::MachineRegisterInfo::getTargetRegisterInfo(), llvm::EVT::getTypeForEVT(), llvm::CCValAssign::getValVT(), llvm::RegState::Implicit, Info, llvm::CallLowering::ArgInfo::IsFixed, llvm::Type::isVoidTy(), llvm::MachineMemOperand::MOStore, MRI, llvm::LLT::pointer(), llvm::SmallVectorTemplateBase< T >::push_back(), llvm::SmallVectorTemplateBase< T, bool >::push_back(), llvm::CallLowering::ArgInfo::Reg, llvm::LLT::scalar(), Size, and llvm::CallLowering::ArgInfo::Ty.

Member Function Documentation

◆ lowerCall()

bool X86CallLowering::lowerCall ( MachineIRBuilder MIRBuilder,
CallingConv::ID  CallConv,
const MachineOperand Callee,
const ArgInfo OrigRet,
ArrayRef< ArgInfo OrigArgs 
) const
overridevirtual

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

CallConv is the calling convention to be used for the call.

Callee is the destination of the call. It should be either a register, globaladdress, or externalsymbol.

ResTy is the type returned by the function

ResReg is the generic virtual register that the returned value should be lowered into.

ArgTys is a list of the types each member of ArgRegs has; used by the target to decide which register/stack slot should be allocated.

ArgRegs is a list of virtual registers containing each argument that needs to be passed.

Returns
true if the lowering succeeded, false otherwise.

Reimplemented from llvm::CallLowering.

Definition at line 374 of file X86CallLowering.cpp.

References llvm::MachineInstrBuilder::add(), llvm::MachineInstrBuilder::addDef(), llvm::MachineInstrBuilder::addImm(), llvm::MachineInstrBuilder::addRegMask(), llvm::MachineInstrBuilder::addUse(), llvm::AArch64CC::AL, llvm::SmallVectorImpl< T >::assign(), llvm::ArrayRef< T >::begin(), llvm::MachineIRBuilder::buildInstr(), llvm::MachineIRBuilder::buildInstrNoInsert(), llvm::MachineIRBuilder::buildMerge(), llvm::MachineIRBuilder::buildUnmerge(), llvm::CallingConv::C, llvm::SmallVectorImpl< T >::clear(), llvm::constrainOperandRegClass(), llvm::SmallVectorBase::empty(), llvm::ArrayRef< T >::end(), F(), llvm::CallLowering::ArgInfo::Flags, llvm::Module::getDataLayout(), llvm::MachineFunction::getFunction(), llvm::TargetSubtargetInfo::getInstrInfo(), llvm::X86Subtarget::getInstrInfo(), llvm::MachineIRBuilder::getMF(), llvm::MachineInstr::getOperand(), llvm::GlobalValue::getParent(), llvm::TargetSubtargetInfo::getRegBankInfo(), llvm::MachineFunction::getRegInfo(), llvm::X86Subtarget::getRegisterInfo(), llvm::MachineFunction::getSubtarget(), llvm::CallLowering::handleAssignments(), llvm::RegState::Implicit, llvm::MachineIRBuilder::insertInstr(), llvm::X86Subtarget::is64Bit(), llvm::ISD::ArgFlagsTy::isByVal(), llvm::X86Subtarget::isCallingConvWin64(), llvm::MachineOperand::isReg(), llvm::X86Subtarget::isTargetLinux(), llvm::CallLowering::ArgInfo::Reg, llvm::MachineOperand::setReg(), TII, TRI, true, and llvm::CallingConv::X86_64_SysV.

◆ lowerFormalArguments()

bool X86CallLowering::lowerFormalArguments ( MachineIRBuilder MIRBuilder,
const Function F,
ArrayRef< unsigned VRegs 
) const
overridevirtual

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

Each argument must end up in the related virtual register described by VRegs. In other words, the first argument should end up in VRegs[0], the second in VRegs[1], and so on. 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 323 of file X86CallLowering.cpp.

References Arg, llvm::Function::arg_empty(), llvm::Function::args(), llvm::MachineBasicBlock::begin(), llvm::MachineIRBuilder::buildMerge(), llvm::Attribute::ByVal, llvm::MachineBasicBlock::empty(), llvm::AttributeList::FirstArgIndex, llvm::MachineFunction::getDataLayout(), llvm::MachineIRBuilder::getMBB(), llvm::MachineIRBuilder::getMF(), llvm::MachineFunction::getRegInfo(), llvm::Value::getType(), llvm::CallLowering::handleAssignments(), llvm::Attribute::InReg, llvm::Function::isVarArg(), llvm::Attribute::Nest, llvm::CallLowering::setArgFlags(), llvm::MachineIRBuilder::setInstr(), llvm::MachineIRBuilder::setMBB(), llvm::Attribute::StructRet, llvm::Attribute::SwiftError, and llvm::Attribute::SwiftSelf.

◆ lowerReturn()

bool X86CallLowering::lowerReturn ( MachineIRBuilder MIRBuilder,
const Value Val,
ArrayRef< unsigned VRegs 
) 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.

Returns
True if the lowering succeeds, false otherwise.

Reimplemented from llvm::CallLowering.

Definition at line 186 of file X86CallLowering.cpp.

References llvm::MachineInstrBuilder::addDef(), llvm::MachineInstrBuilder::addImm(), llvm::MachineBasicBlock::addLiveIn(), assert(), llvm::MachineIRBuilder::buildCopy(), llvm::MachineIRBuilder::buildFrameIndex(), llvm::MachineIRBuilder::buildInstrNoInsert(), llvm::MachineIRBuilder::buildLoad(), llvm::MachineIRBuilder::buildTrunc(), llvm::MachineIRBuilder::buildUnmerge(), llvm::ComputeValueVTs(), llvm::MachineFrameInfo::CreateFixedObject(), llvm::MachineRegisterInfo::createGenericVirtualRegister(), llvm::ArrayRef< T >::empty(), F(), llvm::Type::getContext(), llvm::MachineFunction::getDataLayout(), llvm::MachinePointerInfo::getFixedStack(), llvm::MachineFunction::getFrameInfo(), llvm::MachineFunction::getFunction(), llvm::CCValAssign::getLocInfo(), llvm::CCValAssign::getLocVT(), llvm::MachineFunction::getMachineMemOperand(), llvm::MachineIRBuilder::getMBB(), llvm::MachineIRBuilder::getMF(), llvm::DataLayout::getPointerSizeInBits(), llvm::MachineFunction::getRegInfo(), llvm::TargetRegisterInfo::getRegSizeInBits(), llvm::MVT::getSizeInBits(), llvm::MachineRegisterInfo::getTargetRegisterInfo(), llvm::Value::getType(), llvm::CCValAssign::getValVT(), llvm::CallLowering::handleAssignments(), llvm::RegState::Implicit, llvm::MachineIRBuilder::insertInstr(), llvm::MachineMemOperand::MOInvariant, llvm::MachineMemOperand::MOLoad, llvm::LLT::pointer(), llvm::ARCISD::RET, llvm::AttributeList::ReturnIndex, llvm::LLT::scalar(), llvm::CallLowering::setArgFlags(), Size, and llvm::ArrayRef< T >::size().


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