LLVM  3.7.0
CallingConvLower.h
Go to the documentation of this file.
1 //===-- llvm/CallingConvLower.h - Calling Conventions -----------*- C++ -*-===//
2 //
3 // The LLVM Compiler Infrastructure
4 //
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9 //
10 // This file declares the CCState and CCValAssign classes, used for lowering
11 // and implementing calling conventions.
12 //
13 //===----------------------------------------------------------------------===//
14 
15 #ifndef LLVM_CODEGEN_CALLINGCONVLOWER_H
16 #define LLVM_CODEGEN_CALLINGCONVLOWER_H
17 
18 #include "llvm/ADT/SmallVector.h"
21 #include "llvm/IR/CallingConv.h"
22 #include "llvm/MC/MCRegisterInfo.h"
24 
25 namespace llvm {
26 class CCState;
27 class MVT;
28 class TargetMachine;
29 class TargetRegisterInfo;
30 
31 /// CCValAssign - Represent assignment of one arg/retval to a location.
32 class CCValAssign {
33 public:
34  enum LocInfo {
35  Full, // The value fills the full location.
36  SExt, // The value is sign extended in the location.
37  ZExt, // The value is zero extended in the location.
38  AExt, // The value is extended with undefined upper bits.
39  SExtUpper, // The value is in the upper bits of the location and should be
40  // sign extended when retrieved.
41  ZExtUpper, // The value is in the upper bits of the location and should be
42  // zero extended when retrieved.
43  AExtUpper, // The value is in the upper bits of the location and should be
44  // extended with undefined upper bits when retrieved.
45  BCvt, // The value is bit-converted in the location.
46  VExt, // The value is vector-widened in the location.
47  // FIXME: Not implemented yet. Code that uses AExt to mean
48  // vector-widen should be fixed to use VExt instead.
49  FPExt, // The floating-point value is fp-extended in the location.
50  Indirect // The location contains pointer to the value.
51  // TODO: a subset of the value is in the location.
52  };
53 
54 private:
55  /// ValNo - This is the value number begin assigned (e.g. an argument number).
56  unsigned ValNo;
57 
58  /// Loc is either a stack offset or a register number.
59  unsigned Loc;
60 
61  /// isMem - True if this is a memory loc, false if it is a register loc.
62  unsigned isMem : 1;
63 
64  /// isCustom - True if this arg/retval requires special handling.
65  unsigned isCustom : 1;
66 
67  /// Information about how the value is assigned.
68  LocInfo HTP : 6;
69 
70  /// ValVT - The type of the value being assigned.
71  MVT ValVT;
72 
73  /// LocVT - The type of the location being assigned to.
74  MVT LocVT;
75 public:
76 
77  static CCValAssign getReg(unsigned ValNo, MVT ValVT,
78  unsigned RegNo, MVT LocVT,
79  LocInfo HTP) {
81  Ret.ValNo = ValNo;
82  Ret.Loc = RegNo;
83  Ret.isMem = false;
84  Ret.isCustom = false;
85  Ret.HTP = HTP;
86  Ret.ValVT = ValVT;
87  Ret.LocVT = LocVT;
88  return Ret;
89  }
90 
91  static CCValAssign getCustomReg(unsigned ValNo, MVT ValVT,
92  unsigned RegNo, MVT LocVT,
93  LocInfo HTP) {
95  Ret = getReg(ValNo, ValVT, RegNo, LocVT, HTP);
96  Ret.isCustom = true;
97  return Ret;
98  }
99 
100  static CCValAssign getMem(unsigned ValNo, MVT ValVT,
101  unsigned Offset, MVT LocVT,
102  LocInfo HTP) {
104  Ret.ValNo = ValNo;
105  Ret.Loc = Offset;
106  Ret.isMem = true;
107  Ret.isCustom = false;
108  Ret.HTP = HTP;
109  Ret.ValVT = ValVT;
110  Ret.LocVT = LocVT;
111  return Ret;
112  }
113 
114  static CCValAssign getCustomMem(unsigned ValNo, MVT ValVT,
115  unsigned Offset, MVT LocVT,
116  LocInfo HTP) {
118  Ret = getMem(ValNo, ValVT, Offset, LocVT, HTP);
119  Ret.isCustom = true;
120  return Ret;
121  }
122 
123  // There is no need to differentiate between a pending CCValAssign and other
124  // kinds, as they are stored in a different list.
125  static CCValAssign getPending(unsigned ValNo, MVT ValVT, MVT LocVT,
126  LocInfo HTP, unsigned ExtraInfo = 0) {
127  return getReg(ValNo, ValVT, ExtraInfo, LocVT, HTP);
128  }
129 
130  void convertToReg(unsigned RegNo) {
131  Loc = RegNo;
132  isMem = false;
133  }
134 
135  void convertToMem(unsigned Offset) {
136  Loc = Offset;
137  isMem = true;
138  }
139 
140  unsigned getValNo() const { return ValNo; }
141  MVT getValVT() const { return ValVT; }
142 
143  bool isRegLoc() const { return !isMem; }
144  bool isMemLoc() const { return isMem; }
145 
146  bool needsCustom() const { return isCustom; }
147 
148  unsigned getLocReg() const { assert(isRegLoc()); return Loc; }
149  unsigned getLocMemOffset() const { assert(isMemLoc()); return Loc; }
150  unsigned getExtraInfo() const { return Loc; }
151  MVT getLocVT() const { return LocVT; }
152 
153  LocInfo getLocInfo() const { return HTP; }
154  bool isExtInLoc() const {
155  return (HTP == AExt || HTP == SExt || HTP == ZExt);
156  }
157 
158  bool isUpperBitsInLoc() const {
159  return HTP == AExtUpper || HTP == SExtUpper || HTP == ZExtUpper;
160  }
161 };
162 
163 /// Describes a register that needs to be forwarded from the prologue to a
164 /// musttail call.
167  : VReg(VReg), PReg(PReg), VT(VT) {}
168  unsigned VReg;
171 };
172 
173 /// CCAssignFn - This function assigns a location for Val, updating State to
174 /// reflect the change. It returns 'true' if it failed to handle Val.
175 typedef bool CCAssignFn(unsigned ValNo, MVT ValVT,
176  MVT LocVT, CCValAssign::LocInfo LocInfo,
177  ISD::ArgFlagsTy ArgFlags, CCState &State);
178 
179 /// CCCustomFn - This function assigns a location for Val, possibly updating
180 /// all args to reflect changes and indicates if it handled it. It must set
181 /// isCustom if it handles the arg and returns true.
182 typedef bool CCCustomFn(unsigned &ValNo, MVT &ValVT,
183  MVT &LocVT, CCValAssign::LocInfo &LocInfo,
184  ISD::ArgFlagsTy &ArgFlags, CCState &State);
185 
186 /// ParmContext - This enum tracks whether calling convention lowering is in
187 /// the context of prologue or call generation. Not all backends make use of
188 /// this information.
189 typedef enum { Unknown, Prologue, Call } ParmContext;
190 
191 /// CCState - This class holds information needed while lowering arguments and
192 /// return values. It captures which registers are already assigned and which
193 /// stack slots are used. It provides accessors to allocate these values.
194 class CCState {
195 private:
196  CallingConv::ID CallingConv;
197  bool IsVarArg;
198  MachineFunction &MF;
199  const TargetRegisterInfo &TRI;
201  LLVMContext &Context;
202 
203  unsigned StackOffset;
204  SmallVector<uint32_t, 16> UsedRegs;
205  SmallVector<CCValAssign, 4> PendingLocs;
206 
207  // ByValInfo and SmallVector<ByValInfo, 4> ByValRegs:
208  //
209  // Vector of ByValInfo instances (ByValRegs) is introduced for byval registers
210  // tracking.
211  // Or, in another words it tracks byval parameters that are stored in
212  // general purpose registers.
213  //
214  // For 4 byte stack alignment,
215  // instance index means byval parameter number in formal
216  // arguments set. Assume, we have some "struct_type" with size = 4 bytes,
217  // then, for function "foo":
218  //
219  // i32 foo(i32 %p, %struct_type* %r, i32 %s, %struct_type* %t)
220  //
221  // ByValRegs[0] describes how "%r" is stored (Begin == r1, End == r2)
222  // ByValRegs[1] describes how "%t" is stored (Begin == r3, End == r4).
223  //
224  // In case of 8 bytes stack alignment,
225  // ByValRegs may also contain information about wasted registers.
226  // In function shown above, r3 would be wasted according to AAPCS rules.
227  // And in that case ByValRegs[1].Waste would be "true".
228  // ByValRegs vector size still would be 2,
229  // while "%t" goes to the stack: it wouldn't be described in ByValRegs.
230  //
231  // Supposed use-case for this collection:
232  // 1. Initially ByValRegs is empty, InRegsParamsProcessed is 0.
233  // 2. HandleByVal fillups ByValRegs.
234  // 3. Argument analysis (LowerFormatArguments, for example). After
235  // some byval argument was analyzed, InRegsParamsProcessed is increased.
236  struct ByValInfo {
237  ByValInfo(unsigned B, unsigned E, bool IsWaste = false) :
238  Begin(B), End(E), Waste(IsWaste) {}
239  // First register allocated for current parameter.
240  unsigned Begin;
241 
242  // First after last register allocated for current parameter.
243  unsigned End;
244 
245  // Means that current range of registers doesn't belong to any
246  // parameters. It was wasted due to stack alignment rules.
247  // For more information see:
248  // AAPCS, 5.5 Parameter Passing, Stage C, C.3.
249  bool Waste;
250  };
251  SmallVector<ByValInfo, 4 > ByValRegs;
252 
253  // InRegsParamsProcessed - shows how many instances of ByValRegs was proceed
254  // during argument analysis.
255  unsigned InRegsParamsProcessed;
256 
257 protected:
259 
260 public:
263 
264  void addLoc(const CCValAssign &V) {
265  Locs.push_back(V);
266  }
267 
268  LLVMContext &getContext() const { return Context; }
269  MachineFunction &getMachineFunction() const { return MF; }
270  CallingConv::ID getCallingConv() const { return CallingConv; }
271  bool isVarArg() const { return IsVarArg; }
272 
273  unsigned getNextStackOffset() const { return StackOffset; }
274 
275  /// isAllocated - Return true if the specified register (or an alias) is
276  /// allocated.
277  bool isAllocated(unsigned Reg) const {
278  return UsedRegs[Reg/32] & (1 << (Reg&31));
279  }
280 
281  /// AnalyzeFormalArguments - Analyze an array of argument values,
282  /// incorporating info about the formals into this state.
284  CCAssignFn Fn);
285 
286  /// AnalyzeReturn - Analyze the returned values of a return,
287  /// incorporating info about the result values into this state.
289  CCAssignFn Fn);
290 
291  /// CheckReturn - Analyze the return values of a function, returning
292  /// true if the return can be performed without sret-demotion, and
293  /// false otherwise.
294  bool CheckReturn(const SmallVectorImpl<ISD::OutputArg> &ArgsFlags,
295  CCAssignFn Fn);
296 
297  /// AnalyzeCallOperands - Analyze the outgoing arguments to a call,
298  /// incorporating info about the passed values into this state.
300  CCAssignFn Fn);
301 
302  /// AnalyzeCallOperands - Same as above except it takes vectors of types
303  /// and argument flags.
306  CCAssignFn Fn);
307 
308  /// AnalyzeCallResult - Analyze the return values of a call,
309  /// incorporating info about the passed values into this state.
311  CCAssignFn Fn);
312 
313  /// AnalyzeCallResult - Same as above except it's specialized for calls which
314  /// produce a single value.
315  void AnalyzeCallResult(MVT VT, CCAssignFn Fn);
316 
317  /// getFirstUnallocated - Return the index of the first unallocated register
318  /// in the set, or Regs.size() if they are all allocated.
320  for (unsigned i = 0; i < Regs.size(); ++i)
321  if (!isAllocated(Regs[i]))
322  return i;
323  return Regs.size();
324  }
325 
326  /// AllocateReg - Attempt to allocate one register. If it is not available,
327  /// return zero. Otherwise, return the register, marking it and any aliases
328  /// as allocated.
329  unsigned AllocateReg(unsigned Reg) {
330  if (isAllocated(Reg)) return 0;
331  MarkAllocated(Reg);
332  return Reg;
333  }
334 
335  /// Version of AllocateReg with extra register to be shadowed.
336  unsigned AllocateReg(unsigned Reg, unsigned ShadowReg) {
337  if (isAllocated(Reg)) return 0;
338  MarkAllocated(Reg);
339  MarkAllocated(ShadowReg);
340  return Reg;
341  }
342 
343  /// AllocateReg - Attempt to allocate one of the specified registers. If none
344  /// are available, return zero. Otherwise, return the first one available,
345  /// marking it and any aliases as allocated.
347  unsigned FirstUnalloc = getFirstUnallocated(Regs);
348  if (FirstUnalloc == Regs.size())
349  return 0; // Didn't find the reg.
350 
351  // Mark the register and any aliases as allocated.
352  unsigned Reg = Regs[FirstUnalloc];
353  MarkAllocated(Reg);
354  return Reg;
355  }
356 
357  /// AllocateRegBlock - Attempt to allocate a block of RegsRequired consecutive
358  /// registers. If this is not possible, return zero. Otherwise, return the first
359  /// register of the block that were allocated, marking the entire block as allocated.
360  unsigned AllocateRegBlock(ArrayRef<uint16_t> Regs, unsigned RegsRequired) {
361  if (RegsRequired > Regs.size())
362  return 0;
363 
364  for (unsigned StartIdx = 0; StartIdx <= Regs.size() - RegsRequired;
365  ++StartIdx) {
366  bool BlockAvailable = true;
367  // Check for already-allocated regs in this block
368  for (unsigned BlockIdx = 0; BlockIdx < RegsRequired; ++BlockIdx) {
369  if (isAllocated(Regs[StartIdx + BlockIdx])) {
370  BlockAvailable = false;
371  break;
372  }
373  }
374  if (BlockAvailable) {
375  // Mark the entire block as allocated
376  for (unsigned BlockIdx = 0; BlockIdx < RegsRequired; ++BlockIdx) {
377  MarkAllocated(Regs[StartIdx + BlockIdx]);
378  }
379  return Regs[StartIdx];
380  }
381  }
382  // No block was available
383  return 0;
384  }
385 
386  /// Version of AllocateReg with list of registers to be shadowed.
387  unsigned AllocateReg(ArrayRef<MCPhysReg> Regs, const MCPhysReg *ShadowRegs) {
388  unsigned FirstUnalloc = getFirstUnallocated(Regs);
389  if (FirstUnalloc == Regs.size())
390  return 0; // Didn't find the reg.
391 
392  // Mark the register and any aliases as allocated.
393  unsigned Reg = Regs[FirstUnalloc], ShadowReg = ShadowRegs[FirstUnalloc];
394  MarkAllocated(Reg);
395  MarkAllocated(ShadowReg);
396  return Reg;
397  }
398 
399  /// AllocateStack - Allocate a chunk of stack space with the specified size
400  /// and alignment.
401  unsigned AllocateStack(unsigned Size, unsigned Align) {
402  assert(Align && ((Align - 1) & Align) == 0); // Align is power of 2.
403  StackOffset = ((StackOffset + Align - 1) & ~(Align - 1));
404  unsigned Result = StackOffset;
405  StackOffset += Size;
406  MF.getFrameInfo()->ensureMaxAlignment(Align);
407  return Result;
408  }
409 
410  /// Version of AllocateStack with extra register to be shadowed.
411  unsigned AllocateStack(unsigned Size, unsigned Align, unsigned ShadowReg) {
412  MarkAllocated(ShadowReg);
413  return AllocateStack(Size, Align);
414  }
415 
416  /// Version of AllocateStack with list of extra registers to be shadowed.
417  /// Note that, unlike AllocateReg, this shadows ALL of the shadow registers.
418  unsigned AllocateStack(unsigned Size, unsigned Align,
419  ArrayRef<MCPhysReg> ShadowRegs) {
420  for (unsigned i = 0; i < ShadowRegs.size(); ++i)
421  MarkAllocated(ShadowRegs[i]);
422  return AllocateStack(Size, Align);
423  }
424 
425  // HandleByVal - Allocate a stack slot large enough to pass an argument by
426  // value. The size and alignment information of the argument is encoded in its
427  // parameter attribute.
428  void HandleByVal(unsigned ValNo, MVT ValVT,
429  MVT LocVT, CCValAssign::LocInfo LocInfo,
430  int MinSize, int MinAlign, ISD::ArgFlagsTy ArgFlags);
431 
432  // Returns count of byval arguments that are to be stored (even partly)
433  // in registers.
434  unsigned getInRegsParamsCount() const { return ByValRegs.size(); }
435 
436  // Returns count of byval in-regs arguments proceed.
437  unsigned getInRegsParamsProcessed() const { return InRegsParamsProcessed; }
438 
439  // Get information about N-th byval parameter that is stored in registers.
440  // Here "ByValParamIndex" is N.
441  void getInRegsParamInfo(unsigned InRegsParamRecordIndex,
442  unsigned& BeginReg, unsigned& EndReg) const {
443  assert(InRegsParamRecordIndex < ByValRegs.size() &&
444  "Wrong ByVal parameter index");
445 
446  const ByValInfo& info = ByValRegs[InRegsParamRecordIndex];
447  BeginReg = info.Begin;
448  EndReg = info.End;
449  }
450 
451  // Add information about parameter that is kept in registers.
452  void addInRegsParamInfo(unsigned RegBegin, unsigned RegEnd) {
453  ByValRegs.push_back(ByValInfo(RegBegin, RegEnd));
454  }
455 
456  // Goes either to next byval parameter (excluding "waste" record), or
457  // to the end of collection.
458  // Returns false, if end is reached.
460  unsigned e = ByValRegs.size();
461  if (InRegsParamsProcessed < e)
462  ++InRegsParamsProcessed;
463  return InRegsParamsProcessed < e;
464  }
465 
466  // Clear byval registers tracking info.
468  InRegsParamsProcessed = 0;
469  ByValRegs.clear();
470  }
471 
472  // Rewind byval registers tracking info.
474  InRegsParamsProcessed = 0;
475  }
476 
478 
479  // Get list of pending assignments
481  return PendingLocs;
482  }
483 
484  /// Compute the remaining unused register parameters that would be used for
485  /// the given value type. This is useful when varargs are passed in the
486  /// registers that normal prototyped parameters would be passed in, or for
487  /// implementing perfect forwarding.
489  CCAssignFn Fn);
490 
491  /// Compute the set of registers that need to be preserved and forwarded to
492  /// any musttail calls.
494  SmallVectorImpl<ForwardedRegister> &Forwards, ArrayRef<MVT> RegParmTypes,
495  CCAssignFn Fn);
496 
497 private:
498  /// MarkAllocated - Mark a register and all of its aliases as allocated.
499  void MarkAllocated(unsigned Reg);
500 };
501 
502 
503 
504 } // end namespace llvm
505 
506 #endif
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)
Definition: SmallVector.h:222
static CCValAssign getPending(unsigned ValNo, MVT ValVT, MVT LocVT, LocInfo HTP, unsigned ExtraInfo=0)
MVT getValVT() const
static CCValAssign getCustomReg(unsigned ValNo, MVT ValVT, unsigned RegNo, MVT LocVT, LocInfo HTP)
LocInfo getLocInfo() const
Describes a register that needs to be forwarded from the prologue to a musttail call.
void getInRegsParamInfo(unsigned InRegsParamRecordIndex, unsigned &BeginReg, unsigned &EndReg) const
void AnalyzeFormalArguments(const SmallVectorImpl< ISD::InputArg > &Ins, CCAssignFn Fn)
AnalyzeFormalArguments - Analyze an array of argument values, incorporating info about the formals in...
CallingConv::ID getCallingConv() const
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 getInRegsParamsCount() 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 ...
unsigned getValNo() const
LLVMContext & getContext() const
bool isRegLoc() const
lazy value info
void convertToMem(unsigned Offset)
unsigned AllocateReg(unsigned Reg, unsigned ShadowReg)
Version of AllocateReg with extra register to be shadowed.
bool CCCustomFn(unsigned &ValNo, MVT &ValVT, MVT &LocVT, CCValAssign::LocInfo &LocInfo, ISD::ArgFlagsTy &ArgFlags, CCState &State)
CCCustomFn - This function assigns a location for Val, possibly updating all args to reflect changes ...
ParmContext getCallOrPrologue() const
unsigned AllocateReg(ArrayRef< MCPhysReg > Regs)
AllocateReg - Attempt to allocate one of the specified registers.
This class consists of common code factored out of the SmallVector class to reduce code duplication b...
Definition: APInt.h:33
void addLoc(const CCValAssign &V)
Reg
All possible values of the reg field in the ModR/M byte.
bool isUpperBitsInLoc() const
SmallVectorImpl< llvm::CCValAssign > & getPendingLocs()
MachineFunction & getMachineFunction() const
unsigned getLocReg() const
void addInRegsParamInfo(unsigned RegBegin, unsigned RegEnd)
size_t size() const
size - Get the array size.
Definition: ArrayRef.h:134
unsigned AllocateRegBlock(ArrayRef< uint16_t > Regs, unsigned RegsRequired)
AllocateRegBlock - Attempt to allocate a block of RegsRequired consecutive registers.
static CCValAssign getReg(unsigned ValNo, MVT ValVT, unsigned RegNo, MVT LocVT, LocInfo HTP)
unsigned AllocateReg(ArrayRef< MCPhysReg > Regs, const MCPhysReg *ShadowRegs)
Version of AllocateReg with list of registers to be shadowed.
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.
ForwardedRegister(unsigned VReg, MCPhysReg PReg, MVT VT)
MVT - Machine Value Type.
ParmContext
ParmContext - This enum tracks whether calling convention lowering is in the context of prologue or c...
This is an important class for using LLVM in a threaded context.
Definition: LLVMContext.h:41
bool isExtInLoc() const
MVT getLocVT() const
unsigned getInRegsParamsProcessed() const
bool isVarArg() const
unsigned getNextStackOffset() const
TargetRegisterInfo base class - We assume that the target defines a static array of TargetRegisterDes...
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.
bool needsCustom() const
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 getExtraInfo() const
CCState - This class holds information needed while lowering arguments and return values...
CCValAssign - Represent assignment of one arg/retval to a location.
MachineFrameInfo * getFrameInfo()
getFrameInfo - Return the frame info object for the current function.
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))
unsigned AllocateStack(unsigned Size, unsigned Align, unsigned ShadowReg)
Version of AllocateStack with extra register to be shadowed.
bool isMemLoc() const
void AnalyzeCallOperands(const SmallVectorImpl< ISD::OutputArg > &Outs, CCAssignFn Fn)
AnalyzeCallOperands - Analyze the outgoing arguments to a call, incorporating info about the passed v...
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.
Definition: MathExtras.h:552
void ensureMaxAlignment(unsigned Align)
Make sure the function is at least Align bytes aligned.
unsigned AllocateStack(unsigned Size, unsigned Align, ArrayRef< MCPhysReg > ShadowRegs)
Version of AllocateStack with list of extra registers to be shadowed.
static CCValAssign getCustomMem(unsigned ValNo, MVT ValVT, unsigned Offset, MVT LocVT, LocInfo HTP)
void AnalyzeReturn(const SmallVectorImpl< ISD::OutputArg > &Outs, CCAssignFn Fn)
AnalyzeReturn - Analyze the returned values of a return, incorporating info about the result values i...
bool isAllocated(unsigned Reg) const
isAllocated - Return true if the specified register (or an alias) is allocated.
ParmContext CallOrPrologue
static CCValAssign getMem(unsigned ValNo, MVT ValVT, unsigned Offset, MVT LocVT, LocInfo HTP)
void clearByValRegsInfo()
void rewindByValRegsInfo()
unsigned getLocMemOffset() const
unsigned AllocateReg(unsigned Reg)
AllocateReg - Attempt to allocate one register.
unsigned AllocateStack(unsigned Size, unsigned Align)
AllocateStack - Allocate a chunk of stack space with the specified size and alignment.
void convertToReg(unsigned RegNo)