LLVM  17.0.0git
AArch64MachineFunctionInfo.h
Go to the documentation of this file.
1 //=- AArch64MachineFunctionInfo.h - AArch64 machine function info -*- C++ -*-=//
2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //===----------------------------------------------------------------------===//
8 //
9 // This file declares AArch64-specific per-machine-function information.
10 //
11 //===----------------------------------------------------------------------===//
12 
13 #ifndef LLVM_LIB_TARGET_AARCH64_AARCH64MACHINEFUNCTIONINFO_H
14 #define LLVM_LIB_TARGET_AARCH64_AARCH64MACHINEFUNCTIONINFO_H
15 
16 #include "llvm/ADT/ArrayRef.h"
17 #include "llvm/ADT/SmallPtrSet.h"
18 #include "llvm/ADT/SmallVector.h"
23 #include "llvm/IR/Function.h"
25 #include <cassert>
26 #include <optional>
27 
28 namespace llvm {
29 
30 namespace yaml {
31 struct AArch64FunctionInfo;
32 } // end namespace yaml
33 
34 class AArch64Subtarget;
35 class MachineInstr;
36 
37 /// AArch64FunctionInfo - This class is derived from MachineFunctionInfo and
38 /// contains private AArch64-specific information for each MachineFunction.
40  /// Number of bytes of arguments this function has on the stack. If the callee
41  /// is expected to restore the argument stack this should be a multiple of 16,
42  /// all usable during a tail call.
43  ///
44  /// The alternative would forbid tail call optimisation in some cases: if we
45  /// want to transfer control from a function with 8-bytes of stack-argument
46  /// space to a function with 16-bytes then misalignment of this value would
47  /// make a stack adjustment necessary, which could not be undone by the
48  /// callee.
49  unsigned BytesInStackArgArea = 0;
50 
51  /// The number of bytes to restore to deallocate space for incoming
52  /// arguments. Canonically 0 in the C calling convention, but non-zero when
53  /// callee is expected to pop the args.
54  unsigned ArgumentStackToRestore = 0;
55 
56  /// Space just below incoming stack pointer reserved for arguments being
57  /// passed on the stack during a tail call. This will be the difference
58  /// between the largest tail call argument space needed in this function and
59  /// what's already available by reusing space of incoming arguments.
60  unsigned TailCallReservedStack = 0;
61 
62  /// HasStackFrame - True if this function has a stack frame. Set by
63  /// determineCalleeSaves().
64  bool HasStackFrame = false;
65 
66  /// Amount of stack frame size, not including callee-saved registers.
67  uint64_t LocalStackSize = 0;
68 
69  /// The start and end frame indices for the SVE callee saves.
70  int MinSVECSFrameIndex = 0;
71  int MaxSVECSFrameIndex = 0;
72 
73  /// Amount of stack frame size used for saving callee-saved registers.
74  unsigned CalleeSavedStackSize = 0;
75  unsigned SVECalleeSavedStackSize = 0;
76  bool HasCalleeSavedStackSize = false;
77 
78  /// Number of TLS accesses using the special (combinable)
79  /// _TLS_MODULE_BASE_ symbol.
80  unsigned NumLocalDynamicTLSAccesses = 0;
81 
82  /// FrameIndex for start of varargs area for arguments passed on the
83  /// stack.
84  int VarArgsStackIndex = 0;
85 
86  /// Offset of start of varargs area for arguments passed on the stack.
87  unsigned VarArgsStackOffset = 0;
88 
89  /// FrameIndex for start of varargs area for arguments passed in
90  /// general purpose registers.
91  int VarArgsGPRIndex = 0;
92 
93  /// Size of the varargs area for arguments passed in general purpose
94  /// registers.
95  unsigned VarArgsGPRSize = 0;
96 
97  /// FrameIndex for start of varargs area for arguments passed in
98  /// floating-point registers.
99  int VarArgsFPRIndex = 0;
100 
101  /// Size of the varargs area for arguments passed in floating-point
102  /// registers.
103  unsigned VarArgsFPRSize = 0;
104 
105  /// True if this function has a subset of CSRs that is handled explicitly via
106  /// copies.
107  bool IsSplitCSR = false;
108 
109  /// True when the stack gets realigned dynamically because the size of stack
110  /// frame is unknown at compile time. e.g., in case of VLAs.
111  bool StackRealigned = false;
112 
113  /// True when the callee-save stack area has unused gaps that may be used for
114  /// other stack allocations.
115  bool CalleeSaveStackHasFreeSpace = false;
116 
117  /// SRetReturnReg - sret lowering includes returning the value of the
118  /// returned struct in a register. This field holds the virtual register into
119  /// which the sret argument is passed.
120  Register SRetReturnReg;
121 
122  /// SVE stack size (for predicates and data vectors) are maintained here
123  /// rather than in FrameInfo, as the placement and Stack IDs are target
124  /// specific.
125  uint64_t StackSizeSVE = 0;
126 
127  /// HasCalculatedStackSizeSVE indicates whether StackSizeSVE is valid.
128  bool HasCalculatedStackSizeSVE = false;
129 
130  /// Has a value when it is known whether or not the function uses a
131  /// redzone, and no value otherwise.
132  /// Initialized during frame lowering, unless the function has the noredzone
133  /// attribute, in which case it is set to false at construction.
134  std::optional<bool> HasRedZone;
135 
136  /// ForwardedMustTailRegParms - A list of virtual and physical registers
137  /// that must be forwarded to every musttail call.
138  SmallVector<ForwardedRegister, 1> ForwardedMustTailRegParms;
139 
140  /// FrameIndex for the tagged base pointer.
141  std::optional<int> TaggedBasePointerIndex;
142 
143  /// Offset from SP-at-entry to the tagged base pointer.
144  /// Tagged base pointer is set up to point to the first (lowest address)
145  /// tagged stack slot.
146  unsigned TaggedBasePointerOffset;
147 
148  /// OutliningStyle denotes, if a function was outined, how it was outlined,
149  /// e.g. Tail Call, Thunk, or Function if none apply.
150  std::optional<std::string> OutliningStyle;
151 
152  // Offset from SP-after-callee-saved-spills (i.e. SP-at-entry minus
153  // CalleeSavedStackSize) to the address of the frame record.
154  int CalleeSaveBaseToFrameRecordOffset = 0;
155 
156  /// SignReturnAddress is true if PAC-RET is enabled for the function with
157  /// defaults being sign non-leaf functions only, with the B key.
158  bool SignReturnAddress = false;
159 
160  /// SignReturnAddressAll modifies the default PAC-RET mode to signing leaf
161  /// functions as well.
162  bool SignReturnAddressAll = false;
163 
164  /// SignWithBKey modifies the default PAC-RET mode to signing with the B key.
165  bool SignWithBKey = false;
166 
167  /// BranchTargetEnforcement enables placing BTI instructions at potential
168  /// indirect branch destinations.
169  bool BranchTargetEnforcement = false;
170 
171  /// Whether this function has an extended frame record [Ctx, FP, LR]. If so,
172  /// bit 60 of the in-memory FP will be 1 to enable other tools to detect the
173  /// extended record.
174  bool HasSwiftAsyncContext = false;
175 
176  /// The stack slot where the Swift asynchronous context is stored.
177  int SwiftAsyncContextFrameIdx = std::numeric_limits<int>::max();
178 
179  bool IsMTETagged = false;
180 
181  /// The function has Scalable Vector or Scalable Predicate register argument
182  /// or return type
183  bool IsSVECC = false;
184 
185  /// The frame-index for the TPIDR2 object used for lazy saves.
186  Register LazySaveTPIDR2Obj = 0;
187 
188 
189  /// True if the function need unwind information.
190  mutable std::optional<bool> NeedsDwarfUnwindInfo;
191 
192  /// True if the function need asynchronous unwind information.
193  mutable std::optional<bool> NeedsAsyncDwarfUnwindInfo;
194 
195 public:
196  AArch64FunctionInfo(const Function &F, const AArch64Subtarget *STI);
197 
201  const override;
202 
203  bool isSVECC() const { return IsSVECC; };
204  void setIsSVECC(bool s) { IsSVECC = s; };
205 
206  unsigned getLazySaveTPIDR2Obj() const { return LazySaveTPIDR2Obj; }
207  void setLazySaveTPIDR2Obj(unsigned Reg) { LazySaveTPIDR2Obj = Reg; }
208 
210 
211  unsigned getBytesInStackArgArea() const { return BytesInStackArgArea; }
212  void setBytesInStackArgArea(unsigned bytes) { BytesInStackArgArea = bytes; }
213 
214  unsigned getArgumentStackToRestore() const { return ArgumentStackToRestore; }
215  void setArgumentStackToRestore(unsigned bytes) {
216  ArgumentStackToRestore = bytes;
217  }
218 
219  unsigned getTailCallReservedStack() const { return TailCallReservedStack; }
220  void setTailCallReservedStack(unsigned bytes) {
221  TailCallReservedStack = bytes;
222  }
223 
224  bool hasCalculatedStackSizeSVE() const { return HasCalculatedStackSizeSVE; }
225 
227  HasCalculatedStackSizeSVE = true;
228  StackSizeSVE = S;
229  }
230 
231  uint64_t getStackSizeSVE() const { return StackSizeSVE; }
232 
233  bool hasStackFrame() const { return HasStackFrame; }
234  void setHasStackFrame(bool s) { HasStackFrame = s; }
235 
236  bool isStackRealigned() const { return StackRealigned; }
237  void setStackRealigned(bool s) { StackRealigned = s; }
238 
240  return CalleeSaveStackHasFreeSpace;
241  }
243  CalleeSaveStackHasFreeSpace = s;
244  }
245  bool isSplitCSR() const { return IsSplitCSR; }
246  void setIsSplitCSR(bool s) { IsSplitCSR = s; }
247 
248  void setLocalStackSize(uint64_t Size) { LocalStackSize = Size; }
249  uint64_t getLocalStackSize() const { return LocalStackSize; }
250 
251  void setOutliningStyle(std::string Style) { OutliningStyle = Style; }
252  std::optional<std::string> getOutliningStyle() const {
253  return OutliningStyle;
254  }
255 
256  void setCalleeSavedStackSize(unsigned Size) {
257  CalleeSavedStackSize = Size;
258  HasCalleeSavedStackSize = true;
259  }
260 
261  // When CalleeSavedStackSize has not been set (for example when
262  // some MachineIR pass is run in isolation), then recalculate
263  // the CalleeSavedStackSize directly from the CalleeSavedInfo.
264  // Note: This information can only be recalculated after PEI
265  // has assigned offsets to the callee save objects.
266  unsigned getCalleeSavedStackSize(const MachineFrameInfo &MFI) const {
267  bool ValidateCalleeSavedStackSize = false;
268 
269 #ifndef NDEBUG
270  // Make sure the calculated size derived from the CalleeSavedInfo
271  // equals the cached size that was calculated elsewhere (e.g. in
272  // determineCalleeSaves).
273  ValidateCalleeSavedStackSize = HasCalleeSavedStackSize;
274 #endif
275 
276  if (!HasCalleeSavedStackSize || ValidateCalleeSavedStackSize) {
277  assert(MFI.isCalleeSavedInfoValid() && "CalleeSavedInfo not calculated");
278  if (MFI.getCalleeSavedInfo().empty())
279  return 0;
280 
281  int64_t MinOffset = std::numeric_limits<int64_t>::max();
282  int64_t MaxOffset = std::numeric_limits<int64_t>::min();
283  for (const auto &Info : MFI.getCalleeSavedInfo()) {
284  int FrameIdx = Info.getFrameIdx();
285  if (MFI.getStackID(FrameIdx) != TargetStackID::Default)
286  continue;
287  int64_t Offset = MFI.getObjectOffset(FrameIdx);
288  int64_t ObjSize = MFI.getObjectSize(FrameIdx);
289  MinOffset = std::min<int64_t>(Offset, MinOffset);
290  MaxOffset = std::max<int64_t>(Offset + ObjSize, MaxOffset);
291  }
292 
293  if (SwiftAsyncContextFrameIdx != std::numeric_limits<int>::max()) {
295  int64_t ObjSize = MFI.getObjectSize(getSwiftAsyncContextFrameIdx());
296  MinOffset = std::min<int64_t>(Offset, MinOffset);
297  MaxOffset = std::max<int64_t>(Offset + ObjSize, MaxOffset);
298  }
299 
300  unsigned Size = alignTo(MaxOffset - MinOffset, 16);
301  assert((!HasCalleeSavedStackSize || getCalleeSavedStackSize() == Size) &&
302  "Invalid size calculated for callee saves");
303  return Size;
304  }
305 
306  return getCalleeSavedStackSize();
307  }
308 
309  unsigned getCalleeSavedStackSize() const {
310  assert(HasCalleeSavedStackSize &&
311  "CalleeSavedStackSize has not been calculated");
312  return CalleeSavedStackSize;
313  }
314 
315  // Saves the CalleeSavedStackSize for SVE vectors in 'scalable bytes'
316  void setSVECalleeSavedStackSize(unsigned Size) {
317  SVECalleeSavedStackSize = Size;
318  }
319  unsigned getSVECalleeSavedStackSize() const {
320  return SVECalleeSavedStackSize;
321  }
322 
323  void setMinMaxSVECSFrameIndex(int Min, int Max) {
324  MinSVECSFrameIndex = Min;
325  MaxSVECSFrameIndex = Max;
326  }
327 
328  int getMinSVECSFrameIndex() const { return MinSVECSFrameIndex; }
329  int getMaxSVECSFrameIndex() const { return MaxSVECSFrameIndex; }
330 
331  void incNumLocalDynamicTLSAccesses() { ++NumLocalDynamicTLSAccesses; }
332  unsigned getNumLocalDynamicTLSAccesses() const {
333  return NumLocalDynamicTLSAccesses;
334  }
335 
336  std::optional<bool> hasRedZone() const { return HasRedZone; }
337  void setHasRedZone(bool s) { HasRedZone = s; }
338 
339  int getVarArgsStackIndex() const { return VarArgsStackIndex; }
340  void setVarArgsStackIndex(int Index) { VarArgsStackIndex = Index; }
341 
342  unsigned getVarArgsStackOffset() const { return VarArgsStackOffset; }
343  void setVarArgsStackOffset(unsigned Offset) { VarArgsStackOffset = Offset; }
344 
345  int getVarArgsGPRIndex() const { return VarArgsGPRIndex; }
346  void setVarArgsGPRIndex(int Index) { VarArgsGPRIndex = Index; }
347 
348  unsigned getVarArgsGPRSize() const { return VarArgsGPRSize; }
349  void setVarArgsGPRSize(unsigned Size) { VarArgsGPRSize = Size; }
350 
351  int getVarArgsFPRIndex() const { return VarArgsFPRIndex; }
352  void setVarArgsFPRIndex(int Index) { VarArgsFPRIndex = Index; }
353 
354  unsigned getVarArgsFPRSize() const { return VarArgsFPRSize; }
355  void setVarArgsFPRSize(unsigned Size) { VarArgsFPRSize = Size; }
356 
357  unsigned getSRetReturnReg() const { return SRetReturnReg; }
358  void setSRetReturnReg(unsigned Reg) { SRetReturnReg = Reg; }
359 
360  unsigned getJumpTableEntrySize(int Idx) const {
361  return JumpTableEntryInfo[Idx].first;
362  }
364  return JumpTableEntryInfo[Idx].second;
365  }
366  void setJumpTableEntryInfo(int Idx, unsigned Size, MCSymbol *PCRelSym) {
367  if ((unsigned)Idx >= JumpTableEntryInfo.size())
368  JumpTableEntryInfo.resize(Idx+1);
369  JumpTableEntryInfo[Idx] = std::make_pair(Size, PCRelSym);
370  }
371 
373 
374  const SetOfInstructions &getLOHRelated() const { return LOHRelated; }
375 
376  // Shortcuts for LOH related types.
378  MCLOHType Kind;
379 
380  /// Arguments of this directive. Order matters.
382 
383  public:
385 
387  : Kind(Kind), Args(Args.begin(), Args.end()) {
388  assert(isValidMCLOHType(Kind) && "Invalid LOH directive type!");
389  }
390 
391  MCLOHType getKind() const { return Kind; }
392  LOHArgs getArgs() const { return Args; }
393  };
394 
397 
398  const MILOHContainer &getLOHContainer() const { return LOHContainerSet; }
399 
400  /// Add a LOH directive of this @p Kind and this @p Args.
402  LOHContainerSet.push_back(MILOHDirective(Kind, Args));
403  LOHRelated.insert(Args.begin(), Args.end());
404  }
405 
407  return ForwardedMustTailRegParms;
408  }
409 
410  std::optional<int> getTaggedBasePointerIndex() const {
411  return TaggedBasePointerIndex;
412  }
413  void setTaggedBasePointerIndex(int Index) { TaggedBasePointerIndex = Index; }
414 
415  unsigned getTaggedBasePointerOffset() const {
416  return TaggedBasePointerOffset;
417  }
419  TaggedBasePointerOffset = Offset;
420  }
421 
423  return CalleeSaveBaseToFrameRecordOffset;
424  }
426  CalleeSaveBaseToFrameRecordOffset = Offset;
427  }
428 
429  bool shouldSignReturnAddress(const MachineFunction &MF) const;
430  bool shouldSignReturnAddress(bool SpillsLR) const;
431 
432  bool shouldSignWithBKey() const { return SignWithBKey; }
433  bool isMTETagged() const { return IsMTETagged; }
434 
435  bool branchTargetEnforcement() const { return BranchTargetEnforcement; }
436 
437  void setHasSwiftAsyncContext(bool HasContext) {
438  HasSwiftAsyncContext = HasContext;
439  }
440  bool hasSwiftAsyncContext() const { return HasSwiftAsyncContext; }
441 
443  SwiftAsyncContextFrameIdx = FI;
444  }
445  int getSwiftAsyncContextFrameIdx() const { return SwiftAsyncContextFrameIdx; }
446 
447  bool needsDwarfUnwindInfo(const MachineFunction &MF) const;
448  bool needsAsyncDwarfUnwindInfo(const MachineFunction &MF) const;
449 
450 private:
451  // Hold the lists of LOHs.
452  MILOHContainer LOHContainerSet;
453  SetOfInstructions LOHRelated;
454 
455  SmallVector<std::pair<unsigned, MCSymbol *>, 2> JumpTableEntryInfo;
456 };
457 
458 namespace yaml {
460  std::optional<bool> HasRedZone;
461 
462  AArch64FunctionInfo() = default;
464 
465  void mappingImpl(yaml::IO &YamlIO) override;
466  ~AArch64FunctionInfo() = default;
467 };
468 
469 template <> struct MappingTraits<AArch64FunctionInfo> {
470  static void mapping(IO &YamlIO, AArch64FunctionInfo &MFI) {
471  YamlIO.mapOptional("hasRedZone", MFI.HasRedZone);
472  }
473 };
474 
475 } // end namespace yaml
476 
477 } // end namespace llvm
478 
479 #endif // LLVM_LIB_TARGET_AARCH64_AARCH64MACHINEFUNCTIONINFO_H
llvm::alignTo
uint64_t alignTo(uint64_t Size, Align A)
Returns a multiple of A needed to store Size bytes.
Definition: Alignment.h:155
llvm::AArch64FunctionInfo::setArgumentStackToRestore
void setArgumentStackToRestore(unsigned bytes)
Definition: AArch64MachineFunctionInfo.h:215
llvm::yaml::AArch64FunctionInfo::~AArch64FunctionInfo
~AArch64FunctionInfo()=default
llvm
This is an optimization pass for GlobalISel generic memory operations.
Definition: AddressRanges.h:18
llvm::MCSymbol
MCSymbol - Instances of this class represent a symbol name in the MC file, and MCSymbols are created ...
Definition: MCSymbol.h:41
llvm::AArch64FunctionInfo::getVarArgsFPRIndex
int getVarArgsFPRIndex() const
Definition: AArch64MachineFunctionInfo.h:351
llvm::AArch64FunctionInfo::getJumpTableEntryPCRelSymbol
MCSymbol * getJumpTableEntryPCRelSymbol(int Idx) const
Definition: AArch64MachineFunctionInfo.h:363
llvm::AArch64FunctionInfo::AArch64FunctionInfo
AArch64FunctionInfo(const Function &F, const AArch64Subtarget *STI)
Definition: AArch64MachineFunctionInfo.cpp:85
llvm::yaml::AArch64FunctionInfo::mappingImpl
void mappingImpl(yaml::IO &YamlIO) override
Definition: AArch64MachineFunctionInfo.cpp:30
llvm::AArch64FunctionInfo::hasRedZone
std::optional< bool > hasRedZone() const
Definition: AArch64MachineFunctionInfo.h:336
llvm::Function
Definition: Function.h:59
llvm::AArch64FunctionInfo::needsDwarfUnwindInfo
bool needsDwarfUnwindInfo(const MachineFunction &MF) const
Definition: AArch64MachineFunctionInfo.cpp:132
llvm::MCLOHType
MCLOHType
Linker Optimization Hint Type.
Definition: MCLinkerOptimizationHint.h:33
llvm::AArch64FunctionInfo::MILOHDirective
Definition: AArch64MachineFunctionInfo.h:377
llvm::yaml::MachineFunctionInfo
Targets should override this in a way that mirrors the implementation of llvm::MachineFunctionInfo.
Definition: MIRYamlMapping.h:677
llvm::AArch64FunctionInfo::getMaxSVECSFrameIndex
int getMaxSVECSFrameIndex() const
Definition: AArch64MachineFunctionInfo.h:329
llvm::SmallVector
This is a 'vector' (really, a variable-sized array), optimized for the case when the array is small.
Definition: SmallVector.h:1199
llvm::X86Disassembler::Reg
Reg
All possible values of the reg field in the ModR/M byte.
Definition: X86DisassemblerDecoder.h:462
llvm::AArch64FunctionInfo::setSwiftAsyncContextFrameIdx
void setSwiftAsyncContextFrameIdx(int FI)
Definition: AArch64MachineFunctionInfo.h:442
llvm::AArch64FunctionInfo::isSVECC
bool isSVECC() const
Definition: AArch64MachineFunctionInfo.h:203
llvm::sys::path::end
const_iterator end(StringRef path)
Get end iterator over path.
Definition: Path.cpp:235
llvm::sys::path::begin
const_iterator begin(StringRef path, Style style=Style::native)
Get begin iterator over path.
Definition: Path.cpp:226
YamlIO
IO & YamlIO
Definition: ELFYAML.cpp:1259
llvm::SmallPtrSet< const MachineInstr *, 16 >
llvm::AArch64FunctionInfo::setTaggedBasePointerIndex
void setTaggedBasePointerIndex(int Index)
Definition: AArch64MachineFunctionInfo.h:413
llvm::max
Expected< ExpressionValue > max(const ExpressionValue &Lhs, const ExpressionValue &Rhs)
Definition: FileCheck.cpp:337
llvm::yaml::MappingTraits
Definition: ModuleSummaryIndex.h:53
llvm::AArch64FunctionInfo::setVarArgsStackIndex
void setVarArgsStackIndex(int Index)
Definition: AArch64MachineFunctionInfo.h:340
llvm::AArch64FunctionInfo::isMTETagged
bool isMTETagged() const
Definition: AArch64MachineFunctionInfo.h:433
llvm::AArch64FunctionInfo::setTaggedBasePointerOffset
void setTaggedBasePointerOffset(unsigned Offset)
Definition: AArch64MachineFunctionInfo.h:418
llvm::AArch64FunctionInfo::getLOHRelated
const SetOfInstructions & getLOHRelated() const
Definition: AArch64MachineFunctionInfo.h:374
F
#define F(x, y, z)
Definition: MD5.cpp:55
llvm::AArch64FunctionInfo::getJumpTableEntrySize
unsigned getJumpTableEntrySize(int Idx) const
Definition: AArch64MachineFunctionInfo.h:360
llvm::AArch64FunctionInfo::getOutliningStyle
std::optional< std::string > getOutliningStyle() const
Definition: AArch64MachineFunctionInfo.h:252
llvm::AArch64FunctionInfo::setHasSwiftAsyncContext
void setHasSwiftAsyncContext(bool HasContext)
Definition: AArch64MachineFunctionInfo.h:437
llvm::yaml::MappingTraits< AArch64FunctionInfo >::mapping
static void mapping(IO &YamlIO, AArch64FunctionInfo &MFI)
Definition: AArch64MachineFunctionInfo.h:470
llvm::AArch64FunctionInfo::clone
MachineFunctionInfo * clone(BumpPtrAllocator &Allocator, MachineFunction &DestMF, const DenseMap< MachineBasicBlock *, MachineBasicBlock * > &Src2DstMBB) const override
Make a functionally equivalent copy of this MachineFunctionInfo in MF.
Definition: AArch64MachineFunctionInfo.cpp:110
llvm::AArch64FunctionInfo::MILOHContainer
SmallVector< MILOHDirective, 32 > MILOHContainer
Definition: AArch64MachineFunctionInfo.h:396
MIRYamlMapping.h
llvm::AArch64FunctionInfo::getBytesInStackArgArea
unsigned getBytesInStackArgArea() const
Definition: AArch64MachineFunctionInfo.h:211
llvm::AArch64FunctionInfo::isStackRealigned
bool isStackRealigned() const
Definition: AArch64MachineFunctionInfo.h:236
llvm::AArch64FunctionInfo::setVarArgsFPRSize
void setVarArgsFPRSize(unsigned Size)
Definition: AArch64MachineFunctionInfo.h:355
llvm::AArch64FunctionInfo::setIsSVECC
void setIsSVECC(bool s)
Definition: AArch64MachineFunctionInfo.h:204
llvm::AArch64FunctionInfo::setHasRedZone
void setHasRedZone(bool s)
Definition: AArch64MachineFunctionInfo.h:337
llvm::AArch64FunctionInfo::setBytesInStackArgArea
void setBytesInStackArgArea(unsigned bytes)
Definition: AArch64MachineFunctionInfo.h:212
llvm::dwarf::Index
Index
Definition: Dwarf.h:550
llvm::AArch64FunctionInfo::getNumLocalDynamicTLSAccesses
unsigned getNumLocalDynamicTLSAccesses() const
Definition: AArch64MachineFunctionInfo.h:332
llvm::isValidMCLOHType
static bool isValidMCLOHType(unsigned Kind)
Definition: MCLinkerOptimizationHint.h:48
llvm::MachineFrameInfo::getStackID
uint8_t getStackID(int ObjectIdx) const
Definition: MachineFrameInfo.h:731
llvm::AArch64FunctionInfo::incNumLocalDynamicTLSAccesses
void incNumLocalDynamicTLSAccesses()
Definition: AArch64MachineFunctionInfo.h:331
llvm::AArch64FunctionInfo::setSRetReturnReg
void setSRetReturnReg(unsigned Reg)
Definition: AArch64MachineFunctionInfo.h:358
llvm::AArch64FunctionInfo::getVarArgsStackIndex
int getVarArgsStackIndex() const
Definition: AArch64MachineFunctionInfo.h:339
SmallPtrSet.h
llvm::MachineFrameInfo::getObjectOffset
int64_t getObjectOffset(int ObjectIdx) const
Return the assigned stack offset of the specified object from the incoming stack pointer.
Definition: MachineFrameInfo.h:526
Info
Analysis containing CSE Info
Definition: CSEInfo.cpp:27
llvm::AArch64FunctionInfo::hasStackFrame
bool hasStackFrame() const
Definition: AArch64MachineFunctionInfo.h:233
llvm::AArch64FunctionInfo::MILOHDirective::getArgs
LOHArgs getArgs() const
Definition: AArch64MachineFunctionInfo.h:392
llvm::MachineFrameInfo::isCalleeSavedInfoValid
bool isCalleeSavedInfoValid() const
Has the callee saved info been calculated yet?
Definition: MachineFrameInfo.h:800
llvm::AArch64FunctionInfo::shouldSignWithBKey
bool shouldSignWithBKey() const
Definition: AArch64MachineFunctionInfo.h:432
llvm::AArch64FunctionInfo::setOutliningStyle
void setOutliningStyle(std::string Style)
Definition: AArch64MachineFunctionInfo.h:251
llvm::AArch64FunctionInfo::setVarArgsFPRIndex
void setVarArgsFPRIndex(int Index)
Definition: AArch64MachineFunctionInfo.h:352
llvm::AArch64FunctionInfo::setLazySaveTPIDR2Obj
void setLazySaveTPIDR2Obj(unsigned Reg)
Definition: AArch64MachineFunctionInfo.h:207
llvm::AArch64FunctionInfo::isSplitCSR
bool isSplitCSR() const
Definition: AArch64MachineFunctionInfo.h:245
llvm::AArch64FunctionInfo::getCalleeSaveBaseToFrameRecordOffset
int getCalleeSaveBaseToFrameRecordOffset() const
Definition: AArch64MachineFunctionInfo.h:422
Index
uint32_t Index
Definition: ELFObjHandler.cpp:83
llvm::AArch64FunctionInfo::SetOfInstructions
SmallPtrSet< const MachineInstr *, 16 > SetOfInstructions
Definition: AArch64MachineFunctionInfo.h:372
uint64_t
llvm::MachineFrameInfo::getObjectSize
int64_t getObjectSize(int ObjectIdx) const
Return the size of the specified object.
Definition: MachineFrameInfo.h:470
llvm::AArch64FunctionInfo::getTaggedBasePointerOffset
unsigned getTaggedBasePointerOffset() const
Definition: AArch64MachineFunctionInfo.h:415
s
multiplies can be turned into SHL s
Definition: README.txt:370
llvm::BumpPtrAllocatorImpl
Allocate memory in an ever growing pool, as if by bump-pointer.
Definition: Allocator.h:63
llvm::yaml::AArch64FunctionInfo::AArch64FunctionInfo
AArch64FunctionInfo()=default
llvm::AArch64FunctionInfo::MILOHDirective::getKind
MCLOHType getKind() const
Definition: AArch64MachineFunctionInfo.h:391
llvm::DenseMap
Definition: DenseMap.h:714
llvm::AArch64FunctionInfo::setCalleeSaveBaseToFrameRecordOffset
void setCalleeSaveBaseToFrameRecordOffset(int Offset)
Definition: AArch64MachineFunctionInfo.h:425
llvm::AArch64FunctionInfo::getVarArgsGPRIndex
int getVarArgsGPRIndex() const
Definition: AArch64MachineFunctionInfo.h:345
llvm::AArch64FunctionInfo
AArch64FunctionInfo - This class is derived from MachineFunctionInfo and contains private AArch64-spe...
Definition: AArch64MachineFunctionInfo.h:39
llvm::AArch64FunctionInfo::setVarArgsStackOffset
void setVarArgsStackOffset(unsigned Offset)
Definition: AArch64MachineFunctionInfo.h:343
llvm::AArch64FunctionInfo::MILOHDirective::LOHArgs
ArrayRef< const MachineInstr * > LOHArgs
Definition: AArch64MachineFunctionInfo.h:384
ArrayRef.h
llvm::HexStyle::Style
Style
Definition: MCInstPrinter.h:33
llvm::AArch64FunctionInfo::setCalleeSaveStackHasFreeSpace
void setCalleeSaveStackHasFreeSpace(bool s)
Definition: AArch64MachineFunctionInfo.h:242
assert
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
llvm::AArch64FunctionInfo::getLocalStackSize
uint64_t getLocalStackSize() const
Definition: AArch64MachineFunctionInfo.h:249
llvm::AArch64FunctionInfo::setStackRealigned
void setStackRealigned(bool s)
Definition: AArch64MachineFunctionInfo.h:237
llvm::AArch64FunctionInfo::branchTargetEnforcement
bool branchTargetEnforcement() const
Definition: AArch64MachineFunctionInfo.h:435
llvm::AArch64FunctionInfo::setSVECalleeSavedStackSize
void setSVECalleeSavedStackSize(unsigned Size)
Definition: AArch64MachineFunctionInfo.h:316
llvm::AArch64FunctionInfo::getVarArgsGPRSize
unsigned getVarArgsGPRSize() const
Definition: AArch64MachineFunctionInfo.h:348
llvm::AArch64FunctionInfo::getVarArgsStackOffset
unsigned getVarArgsStackOffset() const
Definition: AArch64MachineFunctionInfo.h:342
llvm::AArch64FunctionInfo::getVarArgsFPRSize
unsigned getVarArgsFPRSize() const
Definition: AArch64MachineFunctionInfo.h:354
llvm::MachineFunction
Definition: MachineFunction.h:258
llvm::MachineFrameInfo::getCalleeSavedInfo
const std::vector< CalleeSavedInfo > & getCalleeSavedInfo() const
Returns a reference to call saved info vector for the current function.
Definition: MachineFrameInfo.h:787
llvm::ArrayRef
ArrayRef - Represent a constant reference to an array (0 or more elements consecutively in memory),...
Definition: APInt.h:33
llvm::min
Expected< ExpressionValue > min(const ExpressionValue &Lhs, const ExpressionValue &Rhs)
Definition: FileCheck.cpp:357
llvm::AArch64FunctionInfo::getSwiftAsyncContextFrameIdx
int getSwiftAsyncContextFrameIdx() const
Definition: AArch64MachineFunctionInfo.h:445
llvm::AArch64FunctionInfo::hasCalculatedStackSizeSVE
bool hasCalculatedStackSizeSVE() const
Definition: AArch64MachineFunctionInfo.h:224
llvm::Offset
@ Offset
Definition: DWP.cpp:406
llvm::AArch64FunctionInfo::getLOHContainer
const MILOHContainer & getLOHContainer() const
Definition: AArch64MachineFunctionInfo.h:398
llvm::AArch64FunctionInfo::setVarArgsGPRIndex
void setVarArgsGPRIndex(int Index)
Definition: AArch64MachineFunctionInfo.h:346
llvm::AArch64FunctionInfo::getForwardedMustTailRegParms
SmallVectorImpl< ForwardedRegister > & getForwardedMustTailRegParms()
Definition: AArch64MachineFunctionInfo.h:406
S
add sub stmia L5 ldr r0 bl L_printf $stub Instead of a and a wouldn t it be better to do three moves *Return an aggregate type is even return S
Definition: README.txt:210
llvm::AArch64FunctionInfo::getTailCallReservedStack
unsigned getTailCallReservedStack() const
Definition: AArch64MachineFunctionInfo.h:219
llvm::AArch64FunctionInfo::setMinMaxSVECSFrameIndex
void setMinMaxSVECSFrameIndex(int Min, int Max)
Definition: AArch64MachineFunctionInfo.h:323
llvm::Register
Wrapper class representing virtual and physical registers.
Definition: Register.h:19
llvm::AArch64FunctionInfo::needsAsyncDwarfUnwindInfo
bool needsAsyncDwarfUnwindInfo(const MachineFunction &MF) const
Definition: AArch64MachineFunctionInfo.cpp:141
llvm::AArch64FunctionInfo::shouldSignReturnAddress
bool shouldSignReturnAddress(const MachineFunction &MF) const
Definition: AArch64MachineFunctionInfo.cpp:125
llvm::AArch64FunctionInfo::hasCalleeSaveStackFreeSpace
bool hasCalleeSaveStackFreeSpace() const
Definition: AArch64MachineFunctionInfo.h:239
llvm::AArch64FunctionInfo::MILOHDirective::MILOHDirective
MILOHDirective(MCLOHType Kind, LOHArgs Args)
Definition: AArch64MachineFunctionInfo.h:386
llvm::AArch64FunctionInfo::getStackSizeSVE
uint64_t getStackSizeSVE() const
Definition: AArch64MachineFunctionInfo.h:231
CallingConvLower.h
llvm::AArch64FunctionInfo::initializeBaseYamlFields
void initializeBaseYamlFields(const yaml::AArch64FunctionInfo &YamlMFI)
Definition: AArch64MachineFunctionInfo.cpp:34
llvm::AArch64FunctionInfo::getCalleeSavedStackSize
unsigned getCalleeSavedStackSize() const
Definition: AArch64MachineFunctionInfo.h:309
MachineFrameInfo.h
llvm::AArch64FunctionInfo::getMinSVECSFrameIndex
int getMinSVECSFrameIndex() const
Definition: AArch64MachineFunctionInfo.h:328
Function.h
llvm::AArch64FunctionInfo::setLocalStackSize
void setLocalStackSize(uint64_t Size)
Definition: AArch64MachineFunctionInfo.h:248
llvm::AArch64FunctionInfo::setJumpTableEntryInfo
void setJumpTableEntryInfo(int Idx, unsigned Size, MCSymbol *PCRelSym)
Definition: AArch64MachineFunctionInfo.h:366
llvm::TargetStackID::Default
@ Default
Definition: TargetFrameLowering.h:28
llvm::AArch64FunctionInfo::getSVECalleeSavedStackSize
unsigned getSVECalleeSavedStackSize() const
Definition: AArch64MachineFunctionInfo.h:319
llvm::AArch64FunctionInfo::getLazySaveTPIDR2Obj
unsigned getLazySaveTPIDR2Obj() const
Definition: AArch64MachineFunctionInfo.h:206
MCLinkerOptimizationHint.h
llvm::AArch64FunctionInfo::getArgumentStackToRestore
unsigned getArgumentStackToRestore() const
Definition: AArch64MachineFunctionInfo.h:214
llvm::MachineFrameInfo
The MachineFrameInfo class represents an abstract stack frame until prolog/epilog code is inserted.
Definition: MachineFrameInfo.h:106
llvm::AArch64FunctionInfo::getSRetReturnReg
unsigned getSRetReturnReg() const
Definition: AArch64MachineFunctionInfo.h:357
SmallVector.h
Allocator
Basic Register Allocator
Definition: RegAllocBasic.cpp:143
llvm::AArch64FunctionInfo::hasSwiftAsyncContext
bool hasSwiftAsyncContext() const
Definition: AArch64MachineFunctionInfo.h:440
llvm::AArch64FunctionInfo::setHasStackFrame
void setHasStackFrame(bool s)
Definition: AArch64MachineFunctionInfo.h:234
llvm::AArch64FunctionInfo::getCalleeSavedStackSize
unsigned getCalleeSavedStackSize(const MachineFrameInfo &MFI) const
Definition: AArch64MachineFunctionInfo.h:266
llvm::SmallVectorImpl
This class consists of common code factored out of the SmallVector class to reduce code duplication b...
Definition: APFloat.h:42
llvm::AArch64FunctionInfo::setCalleeSavedStackSize
void setCalleeSavedStackSize(unsigned Size)
Definition: AArch64MachineFunctionInfo.h:256
llvm::AArch64FunctionInfo::setIsSplitCSR
void setIsSplitCSR(bool s)
Definition: AArch64MachineFunctionInfo.h:246
llvm::AMDGPU::HSAMD::Kernel::Key::Args
constexpr char Args[]
Key for Kernel::Metadata::mArgs.
Definition: AMDGPUMetadata.h:394
llvm::AArch64Subtarget
Definition: AArch64Subtarget.h:38
MachineFunction.h
llvm::yaml::AArch64FunctionInfo::HasRedZone
std::optional< bool > HasRedZone
Definition: AArch64MachineFunctionInfo.h:460
llvm::MachineFunctionInfo
MachineFunctionInfo - This class can be derived from and used by targets to hold private target-speci...
Definition: MachineFunction.h:95
llvm::AArch64FunctionInfo::addLOHDirective
void addLOHDirective(MCLOHType Kind, MILOHArgs Args)
Add a LOH directive of this Kind and this Args.
Definition: AArch64MachineFunctionInfo.h:401
llvm::AArch64FunctionInfo::setTailCallReservedStack
void setTailCallReservedStack(unsigned bytes)
Definition: AArch64MachineFunctionInfo.h:220
llvm::yaml::AArch64FunctionInfo
Definition: AArch64MachineFunctionInfo.h:459
llvm::AArch64FunctionInfo::setStackSizeSVE
void setStackSizeSVE(uint64_t S)
Definition: AArch64MachineFunctionInfo.h:226
llvm::AArch64FunctionInfo::setVarArgsGPRSize
void setVarArgsGPRSize(unsigned Size)
Definition: AArch64MachineFunctionInfo.h:349
llvm::AArch64FunctionInfo::getTaggedBasePointerIndex
std::optional< int > getTaggedBasePointerIndex() const
Definition: AArch64MachineFunctionInfo.h:410
llvm::SmallPtrSetImpl::insert
std::pair< iterator, bool > insert(PtrType Ptr)
Inserts Ptr if and only if there is no element in the container equal to Ptr.
Definition: SmallPtrSet.h:365