|
LLVM
4.0.0
|
#include <CallLowering.h>
Classes | |
| struct | ArgInfo |
| struct | ValueHandler |
| 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... | |
Public Member Functions | |
| CallLowering (const TargetLowering *TLI) | |
| virtual | ~CallLowering () |
| virtual bool | lowerReturn (MachineIRBuilder &MIRBuilder, const Value *Val, unsigned VReg) const |
This hook must be implemented to lower outgoing return values, described by Val, into the specified virtual register VReg. More... | |
| virtual bool | lowerFormalArguments (MachineIRBuilder &MIRBuilder, const Function &F, ArrayRef< unsigned > VRegs) const |
This hook must be implemented to lower the incoming (formal) arguments, described by Args, for GlobalISel. More... | |
| virtual bool | lowerCall (MachineIRBuilder &MIRBuilder, const MachineOperand &Callee, const ArgInfo &OrigRet, ArrayRef< ArgInfo > OrigArgs) const |
| This hook must be implemented to lower the given call instruction, including argument and return value marshalling. More... | |
| virtual bool | lowerCall (MachineIRBuilder &MIRBuilder, const CallInst &CI, unsigned ResReg, ArrayRef< unsigned > ArgRegs, std::function< unsigned()> GetCalleeReg) const |
| This hook must be implemented to lower the given call instruction, including argument and return value marshalling. More... | |
Protected Member Functions | |
| const TargetLowering * | getTLI () 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 OpNum, const DataLayout &DL, const FuncInfoTy &FuncInfo) const |
| bool | handleAssignments (MachineIRBuilder &MIRBuilder, CCAssignFn *AssignFn, ArrayRef< ArgInfo > Args, ValueHandler &Callback) const |
Invoke the AssignFn on each of the given Args and then use Callback to move them to the assigned locations. More... | |
Definition at line 31 of file CallLowering.h.
|
inline |
Definition at line 107 of file CallLowering.h.
|
inlinevirtual |
Definition at line 108 of file CallLowering.h.
|
inlineprotected |
Getter for generic TargetLowering class.
Definition at line 84 of file CallLowering.h.
Referenced by setArgFlags().
|
inlineprotected |
Getter for target specific TargetLowering class.
Definition at line 90 of file CallLowering.h.
|
protected |
Invoke the AssignFn on each of the given Args and then use Callback to move them to the assigned locations.
Definition at line 105 of file CallLowering.cpp.
References llvm::alignTo(), llvm::CallLowering::ValueHandler::assignValueToAddress(), llvm::CallLowering::ValueHandler::assignValueToReg(), F, fuzzer::Flags, llvm::CCValAssign::Full, llvm::Function::getCallingConv(), llvm::Function::getContext(), llvm::Module::getDataLayout(), llvm::MachineFunction::getFunction(), llvm::CCValAssign::getLocMemOffset(), llvm::CCValAssign::getLocReg(), llvm::MachineIRBuilder::getMF(), llvm::GlobalValue::getParent(), llvm::DataLayout::getPointerSize(), llvm::MVT::getSizeInBits(), llvm::CallLowering::ValueHandler::getStackAddress(), llvm::CCValAssign::getValVT(), llvm::MVT::getVT(), i, llvm::MVT::iPTR, llvm::CCValAssign::isMemLoc(), llvm::CCValAssign::isRegLoc(), llvm::Function::isVarArg(), Offset, and llvm::ArrayRef< T >::size().
Referenced by llvm::AArch64CallLowering::lowerCall(), llvm::AArch64CallLowering::lowerFormalArguments(), llvm::ARMCallLowering::lowerFormalArguments(), and llvm::AArch64CallLowering::lowerReturn().
|
inlinevirtual |
This hook must be implemented to lower the given call instruction, including argument and return value marshalling.
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.
Reimplemented in llvm::AArch64CallLowering.
Definition at line 153 of file CallLowering.h.
Referenced by lowerCall().
|
virtual |
This hook must be implemented to lower the given call instruction, including argument and return value marshalling.
ResReg is a register where the call's return value should be stored (or 0 if there is no return value).
ArgRegs is a list of virtual registers containing each argument that needs to be passed.
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.
Definition at line 26 of file CallLowering.cpp.
References llvm::CallInst::arg_operands(), llvm::MachineOperand::CreateGA(), llvm::MachineOperand::CreateImm(), llvm::MachineOperand::CreateReg(), F, llvm::CallInst::getCalledFunction(), llvm::Module::getDataLayout(), llvm::Instruction::getParent(), llvm::BasicBlock::getParent(), llvm::GlobalValue::getParent(), llvm::Value::getType(), i, lowerCall(), llvm::SmallVectorTemplateBase< T, isPodLike< T >::value >::push_back(), llvm::AttributeSet::ReturnIndex, and setArgFlags().
|
inlinevirtual |
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.
Reimplemented in llvm::X86CallLowering, llvm::ARMCallLowering, llvm::AArch64CallLowering, and llvm::AMDGPUCallLowering.
Definition at line 129 of file CallLowering.h.
Referenced by llvm::IRTranslator::runOnMachineFunction().
|
inlinevirtual |
This hook must be implemented to lower outgoing return values, described by Val, into the specified virtual register VReg.
This hook is used by GlobalISel.
Reimplemented in llvm::X86CallLowering, llvm::ARMCallLowering, llvm::AArch64CallLowering, and llvm::AMDGPUCallLowering.
Definition at line 115 of file CallLowering.h.
|
protected |
Definition at line 57 of file CallLowering.cpp.
References llvm::CallLowering::ArgInfo::Flags, llvm::DataLayout::getABITypeAlignment(), llvm::TargetLoweringBase::getByValTypeAlignment(), getTLI(), llvm::DataLayout::getTypeAllocSize(), llvm::AttributeSet::hasAttribute(), llvm::ISD::ArgFlagsTy::isByVal(), llvm::ISD::ArgFlagsTy::isInAlloca(), llvm::ISD::ArgFlagsTy::setByVal(), llvm::ISD::ArgFlagsTy::setByValAlign(), llvm::ISD::ArgFlagsTy::setByValSize(), llvm::ISD::ArgFlagsTy::setInAlloca(), llvm::ISD::ArgFlagsTy::setInReg(), llvm::ISD::ArgFlagsTy::setNest(), llvm::ISD::ArgFlagsTy::setOrigAlign(), llvm::ISD::ArgFlagsTy::setSExt(), llvm::ISD::ArgFlagsTy::setSRet(), llvm::ISD::ArgFlagsTy::setSwiftError(), llvm::ISD::ArgFlagsTy::setSwiftSelf(), llvm::ISD::ArgFlagsTy::setZExt(), and llvm::CallLowering::ArgInfo::Ty.
Referenced by lowerCall(), llvm::AArch64CallLowering::lowerFormalArguments(), llvm::ARMCallLowering::lowerFormalArguments(), and llvm::AArch64CallLowering::lowerReturn().
1.8.6