30 : CallingConv(CC), IsVarArg(isVarArg), MF(mf),
31 TRI(*MF.getSubtarget().getRegisterInfo()), Locs(locs), Context(C),
49 if (MinSize > (
int)Size)
51 if (MinAlign > (
int)Align)
61 void CCState::MarkAllocated(
unsigned Reg) {
63 UsedRegs[*AI/32] |= 1 << (*AI&31);
71 unsigned NumArgs = Ins.
size();
73 for (
unsigned i = 0; i != NumArgs; ++i) {
74 MVT ArgVT = Ins[i].VT;
78 dbgs() <<
"Formal argument #" << i <<
" has unhandled type "
91 for (
unsigned i = 0, e = Outs.
size(); i != e; ++i) {
105 for (
unsigned i = 0, e = Outs.
size(); i != e; ++i) {
110 dbgs() <<
"Return operand #" << i <<
" has unhandled type "
122 unsigned NumOps = Outs.
size();
123 for (
unsigned i = 0; i != NumOps; ++i) {
124 MVT ArgVT = Outs[i].VT;
128 dbgs() <<
"Call operand #" << i <<
" has unhandled type "
140 unsigned NumOps = ArgVTs.
size();
141 for (
unsigned i = 0; i != NumOps; ++i) {
142 MVT ArgVT = ArgVTs[i];
146 dbgs() <<
"Call operand #" << i <<
" has unhandled type "
158 for (
unsigned i = 0, e = Ins.
size(); i != e; ++i) {
163 dbgs() <<
"Call result #" << i <<
" has unhandled type "
175 dbgs() <<
"Call result has unhandled type "
194 unsigned SavedStackOffset = StackOffset;
195 unsigned NumLocs = Locs.size();
204 bool HaveRegParm =
true;
205 while (HaveRegParm) {
209 <<
" while computing remaining regparms\n";
213 HaveRegParm = Locs.back().isRegLoc();
217 assert(NumLocs < Locs.size() &&
"CC assignment failed to add location");
218 for (
unsigned I = NumLocs, E = Locs.size();
I != E; ++
I)
219 if (Locs[
I].isRegLoc())
225 StackOffset = SavedStackOffset;
226 Locs.resize(NumLocs);
237 for (
MVT RegVT : RegParmTypes) {
void AnalyzeCallResult(const SmallVectorImpl< ISD::InputArg > &Ins, CCAssignFn Fn)
AnalyzeCallResult - Analyze the return values of a call, incorporating info about the passed values i...
void push_back(const T &Elt)
Describes a register that needs to be forwarded from the prologue to a musttail call.
unsigned addLiveIn(unsigned PReg, const TargetRegisterClass *RC)
addLiveIn - Add the specified physical register as a live-in value and create a corresponding virtual...
void AnalyzeFormalArguments(const SmallVectorImpl< ISD::InputArg > &Ins, CCAssignFn Fn)
AnalyzeFormalArguments - Analyze an array of argument values, incorporating info about the formals in...
bool CCAssignFn(unsigned ValNo, MVT ValVT, MVT LocVT, CCValAssign::LocInfo LocInfo, ISD::ArgFlagsTy ArgFlags, CCState &State)
CCAssignFn - This function assigns a location for Val, updating State to reflect the change...
uint16_t MCPhysReg
An unsigned integer type large enough to represent all physical registers, but not necessarily virtua...
unsigned getByValSize() const
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 ...
virtual void HandleByVal(CCState *, unsigned &, unsigned) const
Target-specific cleanup for formal ByVal parameters.
std::string getEVTString() const
getEVTString - This function returns value type as a string, e.g.
const TargetSubtargetInfo & getSubtarget() const
getSubtarget - Return the subtarget for which this machine code is being compiled.
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
This class consists of common code factored out of the SmallVector class to reduce code duplication b...
void addLoc(const CCValAssign &V)
Reg
All possible values of the reg field in the ModR/M byte.
static bool isValueTypeInRegForCC(CallingConv::ID CC, MVT VT)
This class defines information used to lower LLVM code to legal SelectionDAG operators that the targe...
unsigned getNumRegs() const
Return the number of registers this target has (useful for sizing arrays holding per register informa...
ArrayRef - Represent a constant reference to an array (0 or more elements consecutively in memory)...
bool isInteger() const
isInteger - Return true if this is an integer, or a vector integer type.
MVT - Machine Value Type.
This is an important class for using LLVM in a threaded context.
bool isVector() const
isVector - Return true if this is a vector value type.
MCRegAliasIterator enumerates all registers aliasing Reg.
EVT - Extended Value Type.
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.
void getRemainingRegParmsForType(SmallVectorImpl< MCPhysReg > &Regs, MVT VT, CCAssignFn Fn)
Compute the remaining unused register parameters that would be used for the given value type...
unsigned getByValAlign() const
This is a 'vector' (really, a variable-sized array), optimized for the case when the array is small...
virtual const TargetLowering * getTargetLowering() const
MachineFrameInfo * getFrameInfo()
getFrameInfo - Return the frame info object for the current function.
X86_FastCall - 'fast' analog of X86_StdCall.
CCState(CallingConv::ID CC, bool isVarArg, MachineFunction &MF, SmallVectorImpl< CCValAssign > &locs, LLVMContext &C)
static cl::opt< AlignMode > Align(cl::desc("Load/store alignment support"), cl::Hidden, cl::init(NoStrictAlign), cl::values(clEnumValN(StrictAlign,"aarch64-strict-align","Disallow all unaligned memory accesses"), clEnumValN(NoStrictAlign,"aarch64-no-strict-align","Allow unaligned memory accesses"), clEnumValEnd))
raw_ostream & dbgs()
dbgs() - This returns a reference to a raw_ostream for debugging messages.
virtual const TargetRegisterClass * getRegClassFor(MVT VT) const
Return the register class that should be used for the specified value type.
void AnalyzeCallOperands(const SmallVectorImpl< ISD::OutputArg > &Outs, CCAssignFn Fn)
AnalyzeCallOperands - Analyze the outgoing arguments to a call, incorporating info about the passed v...
uint64_t RoundUpToAlignment(uint64_t Value, uint64_t Align)
Returns the next integer (mod 2**64) that is greater than or equal to Value and is a multiple of Alig...
A utility class that uses RAII to save and restore the value of a variable.
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...
uint64_t MinAlign(uint64_t A, uint64_t B)
MinAlign - A and B are either alignments or offsets.
void ensureMaxAlignment(unsigned Align)
Make sure the function is at least Align bytes aligned.
MSVC calling convention that passes vectors and vector aggregates in SSE registers.
void AnalyzeReturn(const SmallVectorImpl< ISD::OutputArg > &Outs, CCAssignFn Fn)
AnalyzeReturn - Analyze the returned values of a return, incorporating info about the result values i...
static CCValAssign getMem(unsigned ValNo, MVT ValVT, unsigned Offset, MVT LocVT, LocInfo HTP)
void clearByValRegsInfo()
This file provides utility classes that use RAII to save and restore values.
unsigned AllocateStack(unsigned Size, unsigned Align)
AllocateStack - Allocate a chunk of stack space with the specified size and alignment.
This file describes how to lower LLVM code to machine code.