LLVM 22.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 "AArch64Subtarget.h"
18#include "llvm/ADT/ArrayRef.h"
25#include "llvm/IR/Function.h"
27#include "llvm/MC/MCSymbol.h"
28#include <cassert>
29#include <optional>
30
31namespace llvm {
32
33namespace yaml {
34struct AArch64FunctionInfo;
35} // end namespace yaml
36
37class AArch64Subtarget;
38class MachineInstr;
39
41 int FrameIndex = std::numeric_limits<int>::max();
42 unsigned Uses = 0;
43};
44
45/// AArch64FunctionInfo - This class is derived from MachineFunctionInfo and
46/// contains private AArch64-specific information for each MachineFunction.
48 /// Number of bytes of arguments this function has on the stack. If the callee
49 /// is expected to restore the argument stack this should be a multiple of 16,
50 /// all usable during a tail call.
51 ///
52 /// The alternative would forbid tail call optimisation in some cases: if we
53 /// want to transfer control from a function with 8-bytes of stack-argument
54 /// space to a function with 16-bytes then misalignment of this value would
55 /// make a stack adjustment necessary, which could not be undone by the
56 /// callee.
57 unsigned BytesInStackArgArea = 0;
58
59 /// The number of bytes to restore to deallocate space for incoming
60 /// arguments. Canonically 0 in the C calling convention, but non-zero when
61 /// callee is expected to pop the args.
62 unsigned ArgumentStackToRestore = 0;
63
64 /// Space just below incoming stack pointer reserved for arguments being
65 /// passed on the stack during a tail call. This will be the difference
66 /// between the largest tail call argument space needed in this function and
67 /// what's already available by reusing space of incoming arguments.
68 unsigned TailCallReservedStack = 0;
69
70 /// HasStackFrame - True if this function has a stack frame. Set by
71 /// determineCalleeSaves().
72 bool HasStackFrame = false;
73
74 /// Amount of stack frame size, not including callee-saved registers.
75 uint64_t LocalStackSize = 0;
76
77 /// The start and end frame indices for the SVE callee saves.
78 int MinSVECSFrameIndex = 0;
79 int MaxSVECSFrameIndex = 0;
80
81 /// Amount of stack frame size used for saving callee-saved registers.
82 unsigned CalleeSavedStackSize = 0;
83 unsigned SVECalleeSavedStackSize = 0;
84 bool HasCalleeSavedStackSize = false;
85 bool HasSVECalleeSavedStackSize = false;
86
87 /// Number of TLS accesses using the special (combinable)
88 /// _TLS_MODULE_BASE_ symbol.
89 unsigned NumLocalDynamicTLSAccesses = 0;
90
91 /// FrameIndex for start of varargs area for arguments passed on the
92 /// stack.
93 int VarArgsStackIndex = 0;
94
95 /// Offset of start of varargs area for arguments passed on the stack.
96 unsigned VarArgsStackOffset = 0;
97
98 /// FrameIndex for start of varargs area for arguments passed in
99 /// general purpose registers.
100 int VarArgsGPRIndex = 0;
101
102 /// Size of the varargs area for arguments passed in general purpose
103 /// registers.
104 unsigned VarArgsGPRSize = 0;
105
106 /// FrameIndex for start of varargs area for arguments passed in
107 /// floating-point registers.
108 int VarArgsFPRIndex = 0;
109
110 /// Size of the varargs area for arguments passed in floating-point
111 /// registers.
112 unsigned VarArgsFPRSize = 0;
113
114 /// The stack slots used to add space between FPR and GPR accesses when using
115 /// hazard padding. StackHazardCSRSlotIndex is added between GPR and FPR CSRs.
116 /// StackHazardSlotIndex is added between (sorted) stack objects.
117 int StackHazardSlotIndex = std::numeric_limits<int>::max();
118 int StackHazardCSRSlotIndex = std::numeric_limits<int>::max();
119
120 /// True if this function has a subset of CSRs that is handled explicitly via
121 /// copies.
122 bool IsSplitCSR = false;
123
124 /// True when the stack gets realigned dynamically because the size of stack
125 /// frame is unknown at compile time. e.g., in case of VLAs.
126 bool StackRealigned = false;
127
128 /// True when the callee-save stack area has unused gaps that may be used for
129 /// other stack allocations.
130 bool CalleeSaveStackHasFreeSpace = false;
131
132 /// SRetReturnReg - sret lowering includes returning the value of the
133 /// returned struct in a register. This field holds the virtual register into
134 /// which the sret argument is passed.
135 Register SRetReturnReg;
136
137 /// SVE stack size (for predicates and data vectors) are maintained here
138 /// rather than in FrameInfo, as the placement and Stack IDs are target
139 /// specific.
140 uint64_t StackSizeSVE = 0;
141
142 /// HasCalculatedStackSizeSVE indicates whether StackSizeSVE is valid.
143 bool HasCalculatedStackSizeSVE = false;
144
145 /// Has a value when it is known whether or not the function uses a
146 /// redzone, and no value otherwise.
147 /// Initialized during frame lowering, unless the function has the noredzone
148 /// attribute, in which case it is set to false at construction.
149 std::optional<bool> HasRedZone;
150
151 /// ForwardedMustTailRegParms - A list of virtual and physical registers
152 /// that must be forwarded to every musttail call.
153 SmallVector<ForwardedRegister, 1> ForwardedMustTailRegParms;
154
155 /// FrameIndex for the tagged base pointer.
156 std::optional<int> TaggedBasePointerIndex;
157
158 /// Offset from SP-at-entry to the tagged base pointer.
159 /// Tagged base pointer is set up to point to the first (lowest address)
160 /// tagged stack slot.
161 unsigned TaggedBasePointerOffset;
162
163 /// OutliningStyle denotes, if a function was outined, how it was outlined,
164 /// e.g. Tail Call, Thunk, or Function if none apply.
165 std::optional<std::string> OutliningStyle;
166
167 // Offset from SP-after-callee-saved-spills (i.e. SP-at-entry minus
168 // CalleeSavedStackSize) to the address of the frame record.
169 int CalleeSaveBaseToFrameRecordOffset = 0;
170
171 /// SignReturnAddress is true if PAC-RET is enabled for the function with
172 /// defaults being sign non-leaf functions only, with the B key.
173 bool SignReturnAddress = false;
174
175 /// SignReturnAddressAll modifies the default PAC-RET mode to signing leaf
176 /// functions as well.
177 bool SignReturnAddressAll = false;
178
179 /// SignWithBKey modifies the default PAC-RET mode to signing with the B key.
180 bool SignWithBKey = false;
181
182 /// HasELFSignedGOT is true if the target binary format is ELF and the IR
183 /// module containing the corresponding function has "ptrauth-elf-got" flag
184 /// set to 1.
185 bool HasELFSignedGOT = false;
186
187 /// SigningInstrOffset captures the offset of the PAC-RET signing instruction
188 /// within the prologue, so it can be re-used for authentication in the
189 /// epilogue when using PC as a second salt (FEAT_PAuth_LR)
190 MCSymbol *SignInstrLabel = nullptr;
191
192 /// BranchTargetEnforcement enables placing BTI instructions at potential
193 /// indirect branch destinations.
194 bool BranchTargetEnforcement = false;
195
196 /// Indicates that SP signing should be diversified with PC as-per PAuthLR.
197 /// This is set by -mbranch-protection and will emit NOP instructions unless
198 /// the subtarget feature +pauthlr is also used (in which case non-NOP
199 /// instructions are emitted).
200 bool BranchProtectionPAuthLR = false;
201
202 /// Whether this function has an extended frame record [Ctx, FP, LR]. If so,
203 /// bit 60 of the in-memory FP will be 1 to enable other tools to detect the
204 /// extended record.
205 bool HasSwiftAsyncContext = false;
206
207 /// The stack slot where the Swift asynchronous context is stored.
208 int SwiftAsyncContextFrameIdx = std::numeric_limits<int>::max();
209
210 bool IsMTETagged = false;
211
212 /// The function has Scalable Vector or Scalable Predicate register argument
213 /// or return type
214 bool IsSVECC = false;
215
216 /// Whether this function changes streaming mode within the function.
217 bool HasStreamingModeChanges = false;
218
219 /// True if the function need unwind information.
220 mutable std::optional<bool> NeedsDwarfUnwindInfo;
221
222 /// True if the function need asynchronous unwind information.
223 mutable std::optional<bool> NeedsAsyncDwarfUnwindInfo;
224
225 int64_t StackProbeSize = 0;
226
227 // Holds a register containing pstate.sm. This is set
228 // on function entry to record the initial pstate of a function.
229 Register PStateSMReg = MCRegister::NoRegister;
230
231 // true if PStateSMReg is used.
232 bool PStateSMRegUsed = false;
233
234 // Has the PNReg used to build PTRUE instruction.
235 // The PTRUE is used for the LD/ST of ZReg pairs in save and restore.
236 unsigned PredicateRegForFillSpill = 0;
237
238 // Holds the SME function attributes (streaming mode, ZA/ZT0 state).
239 SMEAttrs SMEFnAttrs;
240
241 // Note: The following properties are only used for the old SME ABI lowering:
242 /// The frame-index for the TPIDR2 object used for lazy saves.
243 TPIDR2Object TPIDR2;
244 // Holds a pointer to a buffer that is large enough to represent
245 // all SME ZA state and any additional state required by the
246 // __arm_sme_save/restore support routines.
247 Register SMESaveBufferAddr = MCRegister::NoRegister;
248 // true if SMESaveBufferAddr is used.
249 bool SMESaveBufferUsed = false;
250
251public:
253
257 const override;
258
259 // Old SME ABI lowering state getters/setters:
260 Register getSMESaveBufferAddr() const { return SMESaveBufferAddr; };
261 void setSMESaveBufferAddr(Register Reg) { SMESaveBufferAddr = Reg; };
262 unsigned isSMESaveBufferUsed() const { return SMESaveBufferUsed; };
263 void setSMESaveBufferUsed(bool Used = true) { SMESaveBufferUsed = Used; };
264 TPIDR2Object &getTPIDR2Obj() { return TPIDR2; }
265
267 PredicateRegForFillSpill = Reg;
268 }
270 return PredicateRegForFillSpill;
271 }
272
273 Register getPStateSMReg() const { return PStateSMReg; };
274 void setPStateSMReg(Register Reg) { PStateSMReg = Reg; };
275
276 unsigned isPStateSMRegUsed() const { return PStateSMRegUsed; };
277 void setPStateSMRegUsed(bool Used = true) { PStateSMRegUsed = Used; };
278
279 bool isSVECC() const { return IsSVECC; };
280 void setIsSVECC(bool s) { IsSVECC = s; };
281
283
284 unsigned getBytesInStackArgArea() const { return BytesInStackArgArea; }
285 void setBytesInStackArgArea(unsigned bytes) { BytesInStackArgArea = bytes; }
286
287 unsigned getArgumentStackToRestore() const { return ArgumentStackToRestore; }
288 void setArgumentStackToRestore(unsigned bytes) {
289 ArgumentStackToRestore = bytes;
290 }
291
292 unsigned getTailCallReservedStack() const { return TailCallReservedStack; }
293 void setTailCallReservedStack(unsigned bytes) {
294 TailCallReservedStack = bytes;
295 }
296
297 bool hasCalculatedStackSizeSVE() const { return HasCalculatedStackSizeSVE; }
298
300 HasCalculatedStackSizeSVE = true;
301 StackSizeSVE = S;
302 }
303
306 return StackSizeSVE;
307 }
308
309 bool hasStackFrame() const { return HasStackFrame; }
310 void setHasStackFrame(bool s) { HasStackFrame = s; }
311
312 bool isStackRealigned() const { return StackRealigned; }
313 void setStackRealigned(bool s) { StackRealigned = s; }
314
316 return CalleeSaveStackHasFreeSpace;
317 }
319 CalleeSaveStackHasFreeSpace = s;
320 }
321 bool isSplitCSR() const { return IsSplitCSR; }
322 void setIsSplitCSR(bool s) { IsSplitCSR = s; }
323
324 void setLocalStackSize(uint64_t Size) { LocalStackSize = Size; }
325 uint64_t getLocalStackSize() const { return LocalStackSize; }
326
327 void setOutliningStyle(const std::string &Style) { OutliningStyle = Style; }
328 std::optional<std::string> getOutliningStyle() const {
329 return OutliningStyle;
330 }
331
333 CalleeSavedStackSize = Size;
334 HasCalleeSavedStackSize = true;
335 }
336
337 // When CalleeSavedStackSize has not been set (for example when
338 // some MachineIR pass is run in isolation), then recalculate
339 // the CalleeSavedStackSize directly from the CalleeSavedInfo.
340 // Note: This information can only be recalculated after PEI
341 // has assigned offsets to the callee save objects.
342 unsigned getCalleeSavedStackSize(const MachineFrameInfo &MFI) const {
343 bool ValidateCalleeSavedStackSize = false;
344
345#ifndef NDEBUG
346 // Make sure the calculated size derived from the CalleeSavedInfo
347 // equals the cached size that was calculated elsewhere (e.g. in
348 // determineCalleeSaves).
349 ValidateCalleeSavedStackSize = HasCalleeSavedStackSize;
350#endif
351
352 if (!HasCalleeSavedStackSize || ValidateCalleeSavedStackSize) {
353 assert(MFI.isCalleeSavedInfoValid() && "CalleeSavedInfo not calculated");
354 if (MFI.getCalleeSavedInfo().empty())
355 return 0;
356
357 int64_t MinOffset = std::numeric_limits<int64_t>::max();
358 int64_t MaxOffset = std::numeric_limits<int64_t>::min();
359 for (const auto &Info : MFI.getCalleeSavedInfo()) {
360 int FrameIdx = Info.getFrameIdx();
361 if (MFI.getStackID(FrameIdx) != TargetStackID::Default)
362 continue;
363 int64_t Offset = MFI.getObjectOffset(FrameIdx);
364 int64_t ObjSize = MFI.getObjectSize(FrameIdx);
365 MinOffset = std::min<int64_t>(Offset, MinOffset);
366 MaxOffset = std::max<int64_t>(Offset + ObjSize, MaxOffset);
367 }
368
369 if (SwiftAsyncContextFrameIdx != std::numeric_limits<int>::max()) {
371 int64_t ObjSize = MFI.getObjectSize(getSwiftAsyncContextFrameIdx());
372 MinOffset = std::min<int64_t>(Offset, MinOffset);
373 MaxOffset = std::max<int64_t>(Offset + ObjSize, MaxOffset);
374 }
375
376 if (StackHazardCSRSlotIndex != std::numeric_limits<int>::max()) {
377 int64_t Offset = MFI.getObjectOffset(StackHazardCSRSlotIndex);
378 int64_t ObjSize = MFI.getObjectSize(StackHazardCSRSlotIndex);
379 MinOffset = std::min<int64_t>(Offset, MinOffset);
380 MaxOffset = std::max<int64_t>(Offset + ObjSize, MaxOffset);
381 }
382
383 unsigned Size = alignTo(MaxOffset - MinOffset, 16);
384 assert((!HasCalleeSavedStackSize || getCalleeSavedStackSize() == Size) &&
385 "Invalid size calculated for callee saves");
386 return Size;
387 }
388
390 }
391
392 unsigned getCalleeSavedStackSize() const {
393 assert(HasCalleeSavedStackSize &&
394 "CalleeSavedStackSize has not been calculated");
395 return CalleeSavedStackSize;
396 }
397
398 // Saves the CalleeSavedStackSize for SVE vectors in 'scalable bytes'
400 SVECalleeSavedStackSize = Size;
401 HasSVECalleeSavedStackSize = true;
402 }
403 unsigned getSVECalleeSavedStackSize() const {
404 assert(HasSVECalleeSavedStackSize &&
405 "SVECalleeSavedStackSize has not been calculated");
406 return SVECalleeSavedStackSize;
407 }
408
409 void setMinMaxSVECSFrameIndex(int Min, int Max) {
410 MinSVECSFrameIndex = Min;
411 MaxSVECSFrameIndex = Max;
412 }
413
414 int getMinSVECSFrameIndex() const { return MinSVECSFrameIndex; }
415 int getMaxSVECSFrameIndex() const { return MaxSVECSFrameIndex; }
416
417 void incNumLocalDynamicTLSAccesses() { ++NumLocalDynamicTLSAccesses; }
419 return NumLocalDynamicTLSAccesses;
420 }
421
422 std::optional<bool> hasRedZone() const { return HasRedZone; }
423 void setHasRedZone(bool s) { HasRedZone = s; }
424
425 int getVarArgsStackIndex() const { return VarArgsStackIndex; }
426 void setVarArgsStackIndex(int Index) { VarArgsStackIndex = Index; }
427
428 unsigned getVarArgsStackOffset() const { return VarArgsStackOffset; }
429 void setVarArgsStackOffset(unsigned Offset) { VarArgsStackOffset = Offset; }
430
431 int getVarArgsGPRIndex() const { return VarArgsGPRIndex; }
432 void setVarArgsGPRIndex(int Index) { VarArgsGPRIndex = Index; }
433
434 unsigned getVarArgsGPRSize() const { return VarArgsGPRSize; }
435 void setVarArgsGPRSize(unsigned Size) { VarArgsGPRSize = Size; }
436
437 int getVarArgsFPRIndex() const { return VarArgsFPRIndex; }
438 void setVarArgsFPRIndex(int Index) { VarArgsFPRIndex = Index; }
439
440 unsigned getVarArgsFPRSize() const { return VarArgsFPRSize; }
441 void setVarArgsFPRSize(unsigned Size) { VarArgsFPRSize = Size; }
442
444 return StackHazardSlotIndex != std::numeric_limits<int>::max();
445 }
446 int getStackHazardSlotIndex() const { return StackHazardSlotIndex; }
448 assert(StackHazardSlotIndex == std::numeric_limits<int>::max());
449 StackHazardSlotIndex = Index;
450 }
451 int getStackHazardCSRSlotIndex() const { return StackHazardCSRSlotIndex; }
453 assert(StackHazardCSRSlotIndex == std::numeric_limits<int>::max());
454 StackHazardCSRSlotIndex = Index;
455 }
456
457 SMEAttrs getSMEFnAttrs() const { return SMEFnAttrs; }
458
459 unsigned getSRetReturnReg() const { return SRetReturnReg; }
460 void setSRetReturnReg(unsigned Reg) { SRetReturnReg = Reg; }
461
462 unsigned getJumpTableEntrySize(int Idx) const {
463 return JumpTableEntryInfo[Idx].first;
464 }
466 return JumpTableEntryInfo[Idx].second;
467 }
468 void setJumpTableEntryInfo(int Idx, unsigned Size, MCSymbol *PCRelSym) {
469 if ((unsigned)Idx >= JumpTableEntryInfo.size())
470 JumpTableEntryInfo.resize(Idx+1);
471 JumpTableEntryInfo[Idx] = std::make_pair(Size, PCRelSym);
472 }
473
475
476 const SetOfInstructions &getLOHRelated() const { return LOHRelated; }
477
478 // Shortcuts for LOH related types.
480 MCLOHType Kind;
481
482 /// Arguments of this directive. Order matters.
484
485 public:
487
489 : Kind(Kind), Args(Args.begin(), Args.end()) {
490 assert(isValidMCLOHType(Kind) && "Invalid LOH directive type!");
491 }
492
493 MCLOHType getKind() const { return Kind; }
494 LOHArgs getArgs() const { return Args; }
495 };
496
499
500 const MILOHContainer &getLOHContainer() const { return LOHContainerSet; }
501
502 /// Add a LOH directive of this @p Kind and this @p Args.
504 LOHContainerSet.push_back(MILOHDirective(Kind, Args));
505 LOHRelated.insert_range(Args);
506 }
507
508 size_t
510 size_t InitialSize = LOHContainerSet.size();
511 erase_if(LOHContainerSet, [&](const auto &D) {
512 return any_of(D.getArgs(), [&](auto *Arg) { return MIs.contains(Arg); });
513 });
514 // In theory there could be an LOH with one label in MIs and another label
515 // outside MIs, however we don't know if the label outside MIs is used in
516 // any other LOHs, so we can't remove them from LOHRelated. In that case, we
517 // might produce a few extra labels, but it won't break anything.
518 LOHRelated.remove_if([&](auto *MI) { return MIs.contains(MI); });
519 return InitialSize - LOHContainerSet.size();
520 };
521
523 return ForwardedMustTailRegParms;
524 }
525
526 std::optional<int> getTaggedBasePointerIndex() const {
527 return TaggedBasePointerIndex;
528 }
529 void setTaggedBasePointerIndex(int Index) { TaggedBasePointerIndex = Index; }
530
531 unsigned getTaggedBasePointerOffset() const {
532 return TaggedBasePointerOffset;
533 }
535 TaggedBasePointerOffset = Offset;
536 }
537
539 return CalleeSaveBaseToFrameRecordOffset;
540 }
542 CalleeSaveBaseToFrameRecordOffset = Offset;
543 }
544
545 bool shouldSignReturnAddress(const MachineFunction &MF) const;
546 bool shouldSignReturnAddress(bool SpillsLR) const;
547
549
550 bool shouldSignWithBKey() const { return SignWithBKey; }
551
552 bool hasELFSignedGOT() const { return HasELFSignedGOT; }
553
554 MCSymbol *getSigningInstrLabel() const { return SignInstrLabel; }
555 void setSigningInstrLabel(MCSymbol *Label) { SignInstrLabel = Label; }
556
557 bool isMTETagged() const { return IsMTETagged; }
558
559 bool branchTargetEnforcement() const { return BranchTargetEnforcement; }
560
561 bool branchProtectionPAuthLR() const { return BranchProtectionPAuthLR; }
562
563 void setHasSwiftAsyncContext(bool HasContext) {
564 HasSwiftAsyncContext = HasContext;
565 }
566 bool hasSwiftAsyncContext() const { return HasSwiftAsyncContext; }
567
569 SwiftAsyncContextFrameIdx = FI;
570 }
571 int getSwiftAsyncContextFrameIdx() const { return SwiftAsyncContextFrameIdx; }
572
573 bool needsDwarfUnwindInfo(const MachineFunction &MF) const;
574 bool needsAsyncDwarfUnwindInfo(const MachineFunction &MF) const;
575
576 bool hasStreamingModeChanges() const { return HasStreamingModeChanges; }
577 void setHasStreamingModeChanges(bool HasChanges) {
578 HasStreamingModeChanges = HasChanges;
579 }
580
581 bool hasStackProbing() const { return StackProbeSize != 0; }
582
583 int64_t getStackProbeSize() const { return StackProbeSize; }
584
585private:
586 // Hold the lists of LOHs.
587 MILOHContainer LOHContainerSet;
588 SetOfInstructions LOHRelated;
589
590 SmallVector<std::pair<unsigned, MCSymbol *>, 2> JumpTableEntryInfo;
591};
592
593namespace yaml {
595 std::optional<bool> HasRedZone;
596 std::optional<uint64_t> StackSizeSVE;
597
600
601 void mappingImpl(yaml::IO &YamlIO) override;
603};
604
606 static void mapping(IO &YamlIO, AArch64FunctionInfo &MFI) {
607 YamlIO.mapOptional("hasRedZone", MFI.HasRedZone);
608 YamlIO.mapOptional("stackSizeSVE", MFI.StackSizeSVE);
609 }
610};
611
612} // end namespace yaml
613
614} // end namespace llvm
615
616#endif // LLVM_LIB_TARGET_AARCH64_AARCH64MACHINEFUNCTIONINFO_H
assert(UImm &&(UImm !=~static_cast< T >(0)) &&"Invalid immediate!")
static GCRegistry::Add< StatepointGC > D("statepoint-example", "an example strategy for statepoint")
Analysis containing CSE Info
Definition: CSEInfo.cpp:27
Returns the sub type a function will return at a given Idx Should correspond to the result type of an ExtractValue instruction executed with just that one unsigned Idx
uint32_t Index
uint64_t Size
IO & YamlIO
Definition: ELFYAML.cpp:1327
IRTranslator LLVM IR MI
#define F(x, y, z)
Definition: MD5.cpp:55
Register Reg
Basic Register Allocator
This file defines the SmallPtrSet class.
This file defines the SmallVector class.
AArch64FunctionInfo - This class is derived from MachineFunctionInfo and contains private AArch64-spe...
void addLOHDirective(MCLOHType Kind, MILOHArgs Args)
Add a LOH directive of this Kind and this Args.
bool needsShadowCallStackPrologueEpilogue(MachineFunction &MF) const
unsigned getCalleeSavedStackSize(const MachineFrameInfo &MFI) const
void setCalleeSaveBaseToFrameRecordOffset(int Offset)
void setVarArgsStackOffset(unsigned Offset)
void setTailCallReservedStack(unsigned bytes)
SmallVector< MILOHDirective, 32 > MILOHContainer
SmallVectorImpl< ForwardedRegister > & getForwardedMustTailRegParms()
bool shouldSignReturnAddress(const MachineFunction &MF) const
void setPredicateRegForFillSpill(unsigned Reg)
void setOutliningStyle(const std::string &Style)
const SetOfInstructions & getLOHRelated() const
void setBytesInStackArgArea(unsigned bytes)
void setCalleeSavedStackSize(unsigned Size)
void setSigningInstrLabel(MCSymbol *Label)
void setHasSwiftAsyncContext(bool HasContext)
std::optional< int > getTaggedBasePointerIndex() const
unsigned getJumpTableEntrySize(int Idx) const
bool needsDwarfUnwindInfo(const MachineFunction &MF) const
size_t clearLinkerOptimizationHints(const SmallPtrSetImpl< MachineInstr * > &MIs)
MCSymbol * getJumpTableEntryPCRelSymbol(int Idx) const
SmallPtrSet< const MachineInstr *, 16 > SetOfInstructions
void setTaggedBasePointerOffset(unsigned Offset)
std::optional< bool > hasRedZone() const
void setSMESaveBufferUsed(bool Used=true)
void setSVECalleeSavedStackSize(unsigned Size)
std::optional< std::string > getOutliningStyle() const
void initializeBaseYamlFields(const yaml::AArch64FunctionInfo &YamlMFI)
const MILOHContainer & getLOHContainer() const
void setJumpTableEntryInfo(int Idx, unsigned Size, MCSymbol *PCRelSym)
bool needsAsyncDwarfUnwindInfo(const MachineFunction &MF) const
MachineFunctionInfo * clone(BumpPtrAllocator &Allocator, MachineFunction &DestMF, const DenseMap< MachineBasicBlock *, MachineBasicBlock * > &Src2DstMBB) const override
Make a functionally equivalent copy of this MachineFunctionInfo in MF.
void setArgumentStackToRestore(unsigned bytes)
void setMinMaxSVECSFrameIndex(int Min, int Max)
void setHasStreamingModeChanges(bool HasChanges)
ArrayRef - Represent a constant reference to an array (0 or more elements consecutively in memory),...
Definition: ArrayRef.h:41
Allocate memory in an ever growing pool, as if by bump-pointer.
Definition: Allocator.h:67
static constexpr unsigned NoRegister
Definition: MCRegister.h:52
MCSymbol - Instances of this class represent a symbol name in the MC file, and MCSymbols are created ...
Definition: MCSymbol.h:42
The MachineFrameInfo class represents an abstract stack frame until prolog/epilog code is inserted.
bool isCalleeSavedInfoValid() const
Has the callee saved info been calculated yet?
int64_t getObjectSize(int ObjectIdx) const
Return the size of the specified object.
const std::vector< CalleeSavedInfo > & getCalleeSavedInfo() const
Returns a reference to call saved info vector for the current function.
uint8_t getStackID(int ObjectIdx) const
int64_t getObjectOffset(int ObjectIdx) const
Return the assigned stack offset of the specified object from the incoming stack pointer.
Wrapper class representing virtual and physical registers.
Definition: Register.h:19
SMEAttrs is a utility class to parse the SME ACLE attributes on functions.
A templated base class for SmallPtrSet which provides the typesafe interface that is common across al...
Definition: SmallPtrSet.h:380
bool remove_if(UnaryPredicate P)
Remove elements that match the given predicate.
Definition: SmallPtrSet.h:435
void insert_range(Range &&R)
Definition: SmallPtrSet.h:490
bool contains(ConstPtrType Ptr) const
Definition: SmallPtrSet.h:476
size_t size() const
Definition: SmallVector.h:79
This class consists of common code factored out of the SmallVector class to reduce code duplication b...
Definition: SmallVector.h:574
void push_back(const T &Elt)
Definition: SmallVector.h:414
This is a 'vector' (really, a variable-sized array), optimized for the case when the array is small.
Definition: SmallVector.h:1197
This is an optimization pass for GlobalISel generic memory operations.
Definition: AddressRanges.h:18
@ Offset
Definition: DWP.cpp:477
static bool isValidMCLOHType(unsigned Kind)
bool any_of(R &&range, UnaryPredicate P)
Provide wrappers to std::any_of which take ranges instead of having to pass begin/end explicitly.
Definition: STLExtras.h:1751
MCLOHType
Linker Optimization Hint Type.
uint64_t alignTo(uint64_t Size, Align A)
Returns a multiple of A needed to store Size bytes.
Definition: Alignment.h:155
void erase_if(Container &C, UnaryPredicate P)
Provide a container algorithm similar to C++ Library Fundamentals v2's erase_if which is equivalent t...
Definition: STLExtras.h:2139
MachineFunctionInfo - This class can be derived from and used by targets to hold private target-speci...
void mappingImpl(yaml::IO &YamlIO) override
Targets should override this in a way that mirrors the implementation of llvm::MachineFunctionInfo.
static void mapping(IO &YamlIO, AArch64FunctionInfo &MFI)