|
LLVM
3.7.0
|
CCState - This class holds information needed while lowering arguments and return values. More...
#include <CallingConvLower.h>
Public Member Functions | |
| CCState (CallingConv::ID CC, bool isVarArg, MachineFunction &MF, SmallVectorImpl< CCValAssign > &locs, LLVMContext &C) | |
| void | addLoc (const CCValAssign &V) |
| LLVMContext & | getContext () const |
| MachineFunction & | getMachineFunction () const |
| CallingConv::ID | getCallingConv () const |
| bool | isVarArg () const |
| unsigned | getNextStackOffset () const |
| bool | isAllocated (unsigned Reg) const |
| isAllocated - Return true if the specified register (or an alias) is allocated. More... | |
| void | AnalyzeFormalArguments (const SmallVectorImpl< ISD::InputArg > &Ins, CCAssignFn Fn) |
| AnalyzeFormalArguments - Analyze an array of argument values, incorporating info about the formals into this state. More... | |
| void | AnalyzeReturn (const SmallVectorImpl< ISD::OutputArg > &Outs, CCAssignFn Fn) |
| AnalyzeReturn - Analyze the returned values of a return, incorporating info about the result values into this state. More... | |
| bool | CheckReturn (const SmallVectorImpl< ISD::OutputArg > &ArgsFlags, CCAssignFn Fn) |
| CheckReturn - Analyze the return values of a function, returning true if the return can be performed without sret-demotion, and false otherwise. More... | |
| void | AnalyzeCallOperands (const SmallVectorImpl< ISD::OutputArg > &Outs, CCAssignFn Fn) |
| AnalyzeCallOperands - Analyze the outgoing arguments to a call, incorporating info about the passed values into this state. More... | |
| void | AnalyzeCallOperands (SmallVectorImpl< MVT > &ArgVTs, SmallVectorImpl< ISD::ArgFlagsTy > &Flags, CCAssignFn Fn) |
| AnalyzeCallOperands - Same as above except it takes vectors of types and argument flags. More... | |
| void | AnalyzeCallResult (const SmallVectorImpl< ISD::InputArg > &Ins, CCAssignFn Fn) |
| AnalyzeCallResult - Analyze the return values of a call, incorporating info about the passed values into this state. More... | |
| void | AnalyzeCallResult (MVT VT, CCAssignFn Fn) |
| AnalyzeCallResult - Same as above except it's specialized for calls which produce a single value. More... | |
| unsigned | getFirstUnallocated (ArrayRef< MCPhysReg > Regs) const |
| getFirstUnallocated - Return the index of the first unallocated register in the set, or Regs.size() if they are all allocated. More... | |
| unsigned | AllocateReg (unsigned Reg) |
| AllocateReg - Attempt to allocate one register. More... | |
| unsigned | AllocateReg (unsigned Reg, unsigned ShadowReg) |
| Version of AllocateReg with extra register to be shadowed. More... | |
| unsigned | AllocateReg (ArrayRef< MCPhysReg > Regs) |
| AllocateReg - Attempt to allocate one of the specified registers. More... | |
| unsigned | AllocateRegBlock (ArrayRef< uint16_t > Regs, unsigned RegsRequired) |
| AllocateRegBlock - Attempt to allocate a block of RegsRequired consecutive registers. More... | |
| unsigned | AllocateReg (ArrayRef< MCPhysReg > Regs, const MCPhysReg *ShadowRegs) |
| Version of AllocateReg with list of registers to be shadowed. More... | |
| unsigned | AllocateStack (unsigned Size, unsigned Align) |
| AllocateStack - Allocate a chunk of stack space with the specified size and alignment. More... | |
| unsigned | AllocateStack (unsigned Size, unsigned Align, unsigned ShadowReg) |
| Version of AllocateStack with extra register to be shadowed. More... | |
| unsigned | AllocateStack (unsigned Size, unsigned Align, ArrayRef< MCPhysReg > ShadowRegs) |
| Version of AllocateStack with list of extra registers to be shadowed. More... | |
| void | HandleByVal (unsigned ValNo, MVT ValVT, MVT LocVT, CCValAssign::LocInfo LocInfo, int MinSize, int MinAlign, ISD::ArgFlagsTy ArgFlags) |
| Allocate space on the stack large enough to pass an argument by value. More... | |
| unsigned | getInRegsParamsCount () const |
| unsigned | getInRegsParamsProcessed () const |
| void | getInRegsParamInfo (unsigned InRegsParamRecordIndex, unsigned &BeginReg, unsigned &EndReg) const |
| void | addInRegsParamInfo (unsigned RegBegin, unsigned RegEnd) |
| bool | nextInRegsParam () |
| void | clearByValRegsInfo () |
| void | rewindByValRegsInfo () |
| ParmContext | getCallOrPrologue () const |
| SmallVectorImpl < llvm::CCValAssign > & | getPendingLocs () |
| void | getRemainingRegParmsForType (SmallVectorImpl< MCPhysReg > &Regs, MVT VT, CCAssignFn Fn) |
| Compute the remaining unused register parameters that would be used for the given value type. More... | |
| void | analyzeMustTailForwardedRegisters (SmallVectorImpl< ForwardedRegister > &Forwards, ArrayRef< MVT > RegParmTypes, CCAssignFn Fn) |
| Compute the set of registers that need to be preserved and forwarded to any musttail calls. More... | |
Protected Attributes | |
| ParmContext | CallOrPrologue |
CCState - This class holds information needed while lowering arguments and return values.
It captures which registers are already assigned and which stack slots are used. It provides accessors to allocate these values.
Definition at line 194 of file CallingConvLower.h.
| CCState::CCState | ( | CallingConv::ID | CC, |
| bool | isVarArg, | ||
| MachineFunction & | MF, | ||
| SmallVectorImpl< CCValAssign > & | locs, | ||
| LLVMContext & | C | ||
| ) |
Definition at line 28 of file CallingConvLower.cpp.
References clearByValRegsInfo(), llvm::MCRegisterInfo::getNumRegs(), and llvm::SmallVectorImpl< T >::resize().
Definition at line 452 of file CallingConvLower.h.
References llvm::SmallVectorTemplateBase< T, isPodLike >::push_back().
Referenced by llvm::MipsTargetLowering::HandleByVal().
|
inline |
Definition at line 264 of file CallingConvLower.h.
Referenced by allocateStack(), AnalyzeArguments(), llvm::CC_ARM_AAPCS_Custom_Aggregate(), CC_Hexagon(), CC_Hexagon32(), CC_Hexagon64(), CC_Hexagon_VarArg(), CC_MipsO32(), CC_Sparc64_Full(), CC_Sparc64_Half(), CC_Sparc_Assign_f64(), CC_Sparc_Assign_SRet(), llvm::f64AssignAAPCS(), llvm::f64AssignAPCS(), llvm::f64RetAssign(), HandleByVal(), RetCC_Hexagon32(), and RetCC_Hexagon64().
AllocateReg - Attempt to allocate one register.
If it is not available, return zero. Otherwise, return the register, marking it and any aliases as allocated.
Definition at line 329 of file CallingConvLower.h.
References isAllocated().
Referenced by AnalyzeArguments(), llvm::CC_ARM_AAPCS_Custom_Aggregate(), CC_Hexagon32(), CC_Hexagon64(), CC_MipsO32(), llvm::CC_PPC32_SVR4_Custom_AlignArgRegs(), llvm::CC_PPC32_SVR4_Custom_AlignFPArgRegs(), CC_Sparc_Assign_f64(), llvm::f64AssignAAPCS(), llvm::f64AssignAPCS(), llvm::f64RetAssign(), llvm::MipsTargetLowering::HandleByVal(), RetCC_Hexagon32(), and RetCC_Hexagon64().
Version of AllocateReg with extra register to be shadowed.
Definition at line 336 of file CallingConvLower.h.
References isAllocated().
AllocateReg - Attempt to allocate one of the specified registers.
If none are available, return zero. Otherwise, return the first one available, marking it and any aliases as allocated.
Definition at line 346 of file CallingConvLower.h.
References getFirstUnallocated(), and llvm::ArrayRef< T >::size().
|
inline |
Version of AllocateReg with list of registers to be shadowed.
Definition at line 387 of file CallingConvLower.h.
References getFirstUnallocated(), and llvm::ArrayRef< T >::size().
|
inline |
AllocateRegBlock - Attempt to allocate a block of RegsRequired consecutive registers.
If this is not possible, return zero. Otherwise, return the first register of the block that were allocated, marking the entire block as allocated.
Definition at line 360 of file CallingConvLower.h.
References isAllocated(), and llvm::ArrayRef< T >::size().
Referenced by llvm::CC_ARM_AAPCS_Custom_Aggregate().
AllocateStack - Allocate a chunk of stack space with the specified size and alignment.
Definition at line 401 of file CallingConvLower.h.
References llvm::MachineFrameInfo::ensureMaxAlignment(), and llvm::MachineFunction::getFrameInfo().
Referenced by allocateStack(), AllocateStack(), llvm::CC_ARM_AAPCS_Custom_Aggregate(), CC_Hexagon(), CC_Hexagon32(), CC_Hexagon64(), CC_Hexagon_VarArg(), CC_MipsO32(), CC_Sparc64_Full(), CC_Sparc64_Half(), CC_Sparc_Assign_f64(), llvm::f64AssignAAPCS(), llvm::f64AssignAPCS(), HandleByVal(), RetCC_Hexagon32(), and RetCC_Hexagon64().
Version of AllocateStack with extra register to be shadowed.
Definition at line 411 of file CallingConvLower.h.
References AllocateStack().
|
inline |
Version of AllocateStack with list of extra registers to be shadowed.
Note that, unlike AllocateReg, this shadows ALL of the shadow registers.
Definition at line 418 of file CallingConvLower.h.
References AllocateStack(), and llvm::ArrayRef< T >::size().
| void CCState::AnalyzeCallOperands | ( | const SmallVectorImpl< ISD::OutputArg > & | Outs, |
| CCAssignFn | Fn | ||
| ) |
AnalyzeCallOperands - Analyze the outgoing arguments to a call, incorporating info about the passed values into this state.
Analyze the outgoing arguments to a call, incorporating info about the passed values into this state.
Definition at line 120 of file CallingConvLower.cpp.
References llvm::dbgs(), llvm::CCValAssign::Full, llvm::EVT::getEVTString(), llvm_unreachable, and llvm::SmallVectorTemplateCommon< T, typename >::size().
Referenced by llvm::SystemZCCState::AnalyzeCallOperands(), llvm::MipsCCState::AnalyzeCallOperands(), AnalyzeVarArgs(), llvm::SparcTargetLowering::LowerCall_32(), and llvm::SparcTargetLowering::LowerCall_64().
| void CCState::AnalyzeCallOperands | ( | SmallVectorImpl< MVT > & | ArgVTs, |
| SmallVectorImpl< ISD::ArgFlagsTy > & | Flags, | ||
| CCAssignFn | Fn | ||
| ) |
AnalyzeCallOperands - Same as above except it takes vectors of types and argument flags.
Same as above except it takes vectors of types and argument flags.
Definition at line 137 of file CallingConvLower.cpp.
References llvm::dbgs(), llvm::CCValAssign::Full, llvm::EVT::getEVTString(), llvm_unreachable, and llvm::SmallVectorTemplateCommon< T >::size().
| void CCState::AnalyzeCallResult | ( | const SmallVectorImpl< ISD::InputArg > & | Ins, |
| CCAssignFn | Fn | ||
| ) |
AnalyzeCallResult - Analyze the return values of a call, incorporating info about the passed values into this state.
Analyze the return values of a call, incorporating info about the passed values into this state.
Definition at line 156 of file CallingConvLower.cpp.
References llvm::dbgs(), llvm::CCValAssign::Full, llvm::EVT::getEVTString(), llvm_unreachable, and llvm::SmallVectorTemplateCommon< T, typename >::size().
Referenced by llvm::MipsCCState::AnalyzeCallResult(), AnalyzeRetResult(), llvm::SystemZTargetLowering::LowerCall(), llvm::SparcTargetLowering::LowerCall_32(), and llvm::HexagonTargetLowering::LowerCallResult().
| void CCState::AnalyzeCallResult | ( | MVT | VT, |
| CCAssignFn | Fn | ||
| ) |
AnalyzeCallResult - Same as above except it's specialized for calls which produce a single value.
Same as above except it's specialized for calls that produce a single value.
Definition at line 172 of file CallingConvLower.cpp.
References llvm::dbgs(), llvm::CCValAssign::Full, llvm::EVT::getEVTString(), and llvm_unreachable.
| void CCState::AnalyzeFormalArguments | ( | const SmallVectorImpl< ISD::InputArg > & | Ins, |
| CCAssignFn | Fn | ||
| ) |
AnalyzeFormalArguments - Analyze an array of argument values, incorporating info about the formals into this state.
Analyze an array of argument values, incorporating info about the formals into this state.
Definition at line 69 of file CallingConvLower.cpp.
References llvm::dbgs(), llvm::CCValAssign::Full, llvm::EVT::getEVTString(), llvm_unreachable, and llvm::SmallVectorTemplateCommon< T, typename >::size().
Referenced by llvm::SystemZCCState::AnalyzeFormalArguments(), llvm::MipsCCState::AnalyzeFormalArguments(), llvm::AMDGPUTargetLowering::AnalyzeFormalArguments(), AnalyzeVarArgs(), llvm::HexagonTargetLowering::LowerFormalArguments(), llvm::SparcTargetLowering::LowerFormalArguments_32(), and llvm::SparcTargetLowering::LowerFormalArguments_64().
| void CCState::analyzeMustTailForwardedRegisters | ( | SmallVectorImpl< ForwardedRegister > & | Forwards, |
| ArrayRef< MVT > | RegParmTypes, | ||
| CCAssignFn | Fn | ||
| ) |
Compute the set of registers that need to be preserved and forwarded to any musttail calls.
Definition at line 229 of file CallingConvLower.cpp.
References llvm::MachineFunction::addLiveIn(), llvm::TargetLoweringBase::getRegClassFor(), getRemainingRegParmsForType(), llvm::MachineFunction::getSubtarget(), llvm::TargetSubtargetInfo::getTargetLowering(), and llvm::SmallVectorTemplateBase< T, isPodLike< T >::value >::push_back().
| void CCState::AnalyzeReturn | ( | const SmallVectorImpl< ISD::OutputArg > & | Outs, |
| CCAssignFn | Fn | ||
| ) |
AnalyzeReturn - Analyze the returned values of a return, incorporating info about the result values into this state.
Analyze the returned values of a return, incorporating info about the result values into this state.
Definition at line 102 of file CallingConvLower.cpp.
References llvm::dbgs(), llvm::CCValAssign::Full, llvm::EVT::getEVTString(), llvm_unreachable, and llvm::SmallVectorTemplateCommon< T, typename >::size().
Referenced by AnalyzeRetResult(), llvm::MipsCCState::AnalyzeReturn(), llvm::HexagonTargetLowering::LowerReturn(), llvm::SystemZTargetLowering::LowerReturn(), llvm::SparcTargetLowering::LowerReturn_32(), and llvm::SparcTargetLowering::LowerReturn_64().
| bool CCState::CheckReturn | ( | const SmallVectorImpl< ISD::OutputArg > & | Outs, |
| CCAssignFn | Fn | ||
| ) |
CheckReturn - Analyze the return values of a function, returning true if the return can be performed without sret-demotion, and false otherwise.
Analyze the return values of a function, returning true if the return can be performed without sret-demotion and false otherwise.
Definition at line 88 of file CallingConvLower.cpp.
References llvm::CCValAssign::Full, and llvm::SmallVectorTemplateCommon< T, typename >::size().
Referenced by llvm::SystemZTargetLowering::CanLowerReturn(), and llvm::MipsCCState::CheckReturn().
|
inline |
Definition at line 467 of file CallingConvLower.h.
References llvm::SmallVectorImpl< T >::clear().
Referenced by CCState().
|
inline |
Definition at line 270 of file CallingConvLower.h.
Referenced by llvm::MipsTargetLowering::HandleByVal().
|
inline |
Definition at line 477 of file CallingConvLower.h.
References CallOrPrologue.
|
inline |
Definition at line 268 of file CallingConvLower.h.
getFirstUnallocated - Return the index of the first unallocated register in the set, or Regs.size() if they are all allocated.
Definition at line 319 of file CallingConvLower.h.
References isAllocated(), and llvm::ArrayRef< T >::size().
Referenced by AllocateReg(), llvm::CC_ARM_AAPCS_Custom_Aggregate(), CC_MipsO32(), llvm::CC_PPC32_SVR4_Custom_AlignArgRegs(), llvm::CC_PPC32_SVR4_Custom_AlignFPArgRegs(), and llvm::MipsTargetLowering::HandleByVal().
|
inline |
Definition at line 441 of file CallingConvLower.h.
References info, and llvm::SmallVectorTemplateCommon< T, typename >::size().
|
inline |
Definition at line 434 of file CallingConvLower.h.
References llvm::SmallVectorTemplateCommon< T, typename >::size().
|
inline |
Definition at line 437 of file CallingConvLower.h.
|
inline |
Definition at line 269 of file CallingConvLower.h.
Referenced by CC_MipsO32().
|
inline |
Definition at line 273 of file CallingConvLower.h.
Referenced by llvm::CC_ARM_AAPCS_Custom_Aggregate().
|
inline |
Definition at line 480 of file CallingConvLower.h.
Referenced by llvm::CC_ARM_AAPCS_Custom_Aggregate().
| void CCState::getRemainingRegParmsForType | ( | SmallVectorImpl< MCPhysReg > & | Regs, |
| MVT | VT, | ||
| CCAssignFn | Fn | ||
| ) |
Compute the remaining unused register parameters that would be used for the given value type.
This is useful when varargs are passed in the registers that normal prototyped parameters would be passed in, or for implementing perfect forwarding.
Definition at line 192 of file CallingConvLower.cpp.
References llvm::dbgs(), llvm::CCValAssign::Full, llvm::EVT::getEVTString(), I, isValueTypeInRegForCC(), llvm_unreachable, llvm::SmallVectorTemplateBase< T, isPodLike >::push_back(), and llvm::ISD::ArgFlagsTy::setInReg().
Referenced by analyzeMustTailForwardedRegisters().
| void CCState::HandleByVal | ( | unsigned | ValNo, |
| MVT | ValVT, | ||
| MVT | LocVT, | ||
| CCValAssign::LocInfo | LocInfo, | ||
| int | MinSize, | ||
| int | MinAlign, | ||
| ISD::ArgFlagsTy | ArgFlags | ||
| ) |
Allocate space on the stack large enough to pass an argument by value.
The size and alignment information of the argument is encoded in its parameter attribute.
Definition at line 43 of file CallingConvLower.cpp.
References addLoc(), Align(), AllocateStack(), llvm::MachineFrameInfo::ensureMaxAlignment(), llvm::ISD::ArgFlagsTy::getByValAlign(), llvm::ISD::ArgFlagsTy::getByValSize(), llvm::MachineFunction::getFrameInfo(), llvm::CCValAssign::getMem(), llvm::MachineFunction::getSubtarget(), llvm::TargetSubtargetInfo::getTargetLowering(), llvm::TargetLowering::HandleByVal(), llvm::MinAlign(), and llvm::RoundUpToAlignment().
Referenced by AnalyzeArguments().
isAllocated - Return true if the specified register (or an alias) is allocated.
Definition at line 277 of file CallingConvLower.h.
Referenced by AllocateReg(), AllocateRegBlock(), and getFirstUnallocated().
|
inline |
Definition at line 271 of file CallingConvLower.h.
Referenced by AnalyzeArguments(), and CC_MipsO32().
|
inline |
Definition at line 459 of file CallingConvLower.h.
References llvm::SmallVectorTemplateCommon< T, typename >::size().
|
inline |
Definition at line 473 of file CallingConvLower.h.
|
protected |
Definition at line 258 of file CallingConvLower.h.
Referenced by getCallOrPrologue().
1.8.6