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 {
35} // end namespace yaml
36
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 // Has the PNReg used to build PTRUE instruction.
232 // The PTRUE is used for the LD/ST of ZReg pairs in save and restore.
233 unsigned PredicateRegForFillSpill = 0;
234
235 // Holds the SME function attributes (streaming mode, ZA/ZT0 state).
236 SMEAttrs SMEFnAttrs;
237
238 // Holds the TPIDR2 block if allocated early (for Windows/stack probes
239 // support).
240 Register EarlyAllocSMESaveBuffer = AArch64::NoRegister;
241
242 // Note: The following properties are only used for the old SME ABI lowering:
243 /// The frame-index for the TPIDR2 object used for lazy saves.
244 TPIDR2Object TPIDR2;
245 // Holds a pointer to a buffer that is large enough to represent
246 // all SME ZA state and any additional state required by the
247 // __arm_sme_save/restore support routines.
248 Register SMESaveBufferAddr = MCRegister::NoRegister;
249 // true if SMESaveBufferAddr is used.
250 bool SMESaveBufferUsed = false;
251
252public:
254
258 const override;
259
261 EarlyAllocSMESaveBuffer = Ptr;
262 }
263
265 return EarlyAllocSMESaveBuffer;
266 }
267
268 // Old SME ABI lowering state getters/setters:
269 Register getSMESaveBufferAddr() const { return SMESaveBufferAddr; };
270 void setSMESaveBufferAddr(Register Reg) { SMESaveBufferAddr = Reg; };
271 unsigned isSMESaveBufferUsed() const { return SMESaveBufferUsed; };
272 void setSMESaveBufferUsed(bool Used = true) { SMESaveBufferUsed = Used; };
273 TPIDR2Object &getTPIDR2Obj() { return TPIDR2; }
274
276 PredicateRegForFillSpill = Reg;
277 }
279 return PredicateRegForFillSpill;
280 }
281
282 Register getPStateSMReg() const { return PStateSMReg; };
283 void setPStateSMReg(Register Reg) { PStateSMReg = Reg; };
284
285 bool isSVECC() const { return IsSVECC; };
286 void setIsSVECC(bool s) { IsSVECC = s; };
287
289
290 unsigned getBytesInStackArgArea() const { return BytesInStackArgArea; }
291 void setBytesInStackArgArea(unsigned bytes) { BytesInStackArgArea = bytes; }
292
293 unsigned getArgumentStackToRestore() const { return ArgumentStackToRestore; }
294 void setArgumentStackToRestore(unsigned bytes) {
295 ArgumentStackToRestore = bytes;
296 }
297
298 unsigned getTailCallReservedStack() const { return TailCallReservedStack; }
299 void setTailCallReservedStack(unsigned bytes) {
300 TailCallReservedStack = bytes;
301 }
302
303 bool hasCalculatedStackSizeSVE() const { return HasCalculatedStackSizeSVE; }
304
306 HasCalculatedStackSizeSVE = true;
307 StackSizeSVE = S;
308 }
309
312 return StackSizeSVE;
313 }
314
315 bool hasStackFrame() const { return HasStackFrame; }
316 void setHasStackFrame(bool s) { HasStackFrame = s; }
317
318 bool isStackRealigned() const { return StackRealigned; }
319 void setStackRealigned(bool s) { StackRealigned = s; }
320
322 return CalleeSaveStackHasFreeSpace;
323 }
325 CalleeSaveStackHasFreeSpace = s;
326 }
327 bool isSplitCSR() const { return IsSplitCSR; }
328 void setIsSplitCSR(bool s) { IsSplitCSR = s; }
329
330 void setLocalStackSize(uint64_t Size) { LocalStackSize = Size; }
331 uint64_t getLocalStackSize() const { return LocalStackSize; }
332
333 void setOutliningStyle(const std::string &Style) { OutliningStyle = Style; }
334 std::optional<std::string> getOutliningStyle() const {
335 return OutliningStyle;
336 }
337
339 CalleeSavedStackSize = Size;
340 HasCalleeSavedStackSize = true;
341 }
342
343 // When CalleeSavedStackSize has not been set (for example when
344 // some MachineIR pass is run in isolation), then recalculate
345 // the CalleeSavedStackSize directly from the CalleeSavedInfo.
346 // Note: This information can only be recalculated after PEI
347 // has assigned offsets to the callee save objects.
348 unsigned getCalleeSavedStackSize(const MachineFrameInfo &MFI) const {
349 bool ValidateCalleeSavedStackSize = false;
350
351#ifndef NDEBUG
352 // Make sure the calculated size derived from the CalleeSavedInfo
353 // equals the cached size that was calculated elsewhere (e.g. in
354 // determineCalleeSaves).
355 ValidateCalleeSavedStackSize = HasCalleeSavedStackSize;
356#endif
357
358 if (!HasCalleeSavedStackSize || ValidateCalleeSavedStackSize) {
359 assert(MFI.isCalleeSavedInfoValid() && "CalleeSavedInfo not calculated");
360 if (MFI.getCalleeSavedInfo().empty())
361 return 0;
362
363 int64_t MinOffset = std::numeric_limits<int64_t>::max();
364 int64_t MaxOffset = std::numeric_limits<int64_t>::min();
365 for (const auto &Info : MFI.getCalleeSavedInfo()) {
366 int FrameIdx = Info.getFrameIdx();
367 if (MFI.getStackID(FrameIdx) != TargetStackID::Default)
368 continue;
369 int64_t Offset = MFI.getObjectOffset(FrameIdx);
370 int64_t ObjSize = MFI.getObjectSize(FrameIdx);
371 MinOffset = std::min<int64_t>(Offset, MinOffset);
372 MaxOffset = std::max<int64_t>(Offset + ObjSize, MaxOffset);
373 }
374
375 if (SwiftAsyncContextFrameIdx != std::numeric_limits<int>::max()) {
377 int64_t ObjSize = MFI.getObjectSize(getSwiftAsyncContextFrameIdx());
378 MinOffset = std::min<int64_t>(Offset, MinOffset);
379 MaxOffset = std::max<int64_t>(Offset + ObjSize, MaxOffset);
380 }
381
382 if (StackHazardCSRSlotIndex != std::numeric_limits<int>::max()) {
383 int64_t Offset = MFI.getObjectOffset(StackHazardCSRSlotIndex);
384 int64_t ObjSize = MFI.getObjectSize(StackHazardCSRSlotIndex);
385 MinOffset = std::min<int64_t>(Offset, MinOffset);
386 MaxOffset = std::max<int64_t>(Offset + ObjSize, MaxOffset);
387 }
388
389 unsigned Size = alignTo(MaxOffset - MinOffset, 16);
390 assert((!HasCalleeSavedStackSize || getCalleeSavedStackSize() == Size) &&
391 "Invalid size calculated for callee saves");
392 return Size;
393 }
394
396 }
397
398 unsigned getCalleeSavedStackSize() const {
399 assert(HasCalleeSavedStackSize &&
400 "CalleeSavedStackSize has not been calculated");
401 return CalleeSavedStackSize;
402 }
403
404 // Saves the CalleeSavedStackSize for SVE vectors in 'scalable bytes'
406 SVECalleeSavedStackSize = Size;
407 HasSVECalleeSavedStackSize = true;
408 }
409 unsigned getSVECalleeSavedStackSize() const {
410 assert(HasSVECalleeSavedStackSize &&
411 "SVECalleeSavedStackSize has not been calculated");
412 return SVECalleeSavedStackSize;
413 }
414
415 void setMinMaxSVECSFrameIndex(int Min, int Max) {
416 MinSVECSFrameIndex = Min;
417 MaxSVECSFrameIndex = Max;
418 }
419
420 int getMinSVECSFrameIndex() const { return MinSVECSFrameIndex; }
421 int getMaxSVECSFrameIndex() const { return MaxSVECSFrameIndex; }
422
423 void incNumLocalDynamicTLSAccesses() { ++NumLocalDynamicTLSAccesses; }
425 return NumLocalDynamicTLSAccesses;
426 }
427
428 std::optional<bool> hasRedZone() const { return HasRedZone; }
429 void setHasRedZone(bool s) { HasRedZone = s; }
430
431 int getVarArgsStackIndex() const { return VarArgsStackIndex; }
432 void setVarArgsStackIndex(int Index) { VarArgsStackIndex = Index; }
433
434 unsigned getVarArgsStackOffset() const { return VarArgsStackOffset; }
435 void setVarArgsStackOffset(unsigned Offset) { VarArgsStackOffset = Offset; }
436
437 int getVarArgsGPRIndex() const { return VarArgsGPRIndex; }
438 void setVarArgsGPRIndex(int Index) { VarArgsGPRIndex = Index; }
439
440 unsigned getVarArgsGPRSize() const { return VarArgsGPRSize; }
441 void setVarArgsGPRSize(unsigned Size) { VarArgsGPRSize = Size; }
442
443 int getVarArgsFPRIndex() const { return VarArgsFPRIndex; }
444 void setVarArgsFPRIndex(int Index) { VarArgsFPRIndex = Index; }
445
446 unsigned getVarArgsFPRSize() const { return VarArgsFPRSize; }
447 void setVarArgsFPRSize(unsigned Size) { VarArgsFPRSize = Size; }
448
450 return StackHazardSlotIndex != std::numeric_limits<int>::max();
451 }
452 int getStackHazardSlotIndex() const { return StackHazardSlotIndex; }
453 void setStackHazardSlotIndex(int Index) {
454 assert(StackHazardSlotIndex == std::numeric_limits<int>::max());
455 StackHazardSlotIndex = Index;
456 }
457 int getStackHazardCSRSlotIndex() const { return StackHazardCSRSlotIndex; }
459 assert(StackHazardCSRSlotIndex == std::numeric_limits<int>::max());
460 StackHazardCSRSlotIndex = Index;
461 }
462
463 SMEAttrs getSMEFnAttrs() const { return SMEFnAttrs; }
464
465 unsigned getSRetReturnReg() const { return SRetReturnReg; }
466 void setSRetReturnReg(unsigned Reg) { SRetReturnReg = Reg; }
467
468 unsigned getJumpTableEntrySize(int Idx) const {
469 return JumpTableEntryInfo[Idx].first;
470 }
472 return JumpTableEntryInfo[Idx].second;
473 }
474 void setJumpTableEntryInfo(int Idx, unsigned Size, MCSymbol *PCRelSym) {
475 if ((unsigned)Idx >= JumpTableEntryInfo.size())
476 JumpTableEntryInfo.resize(Idx+1);
477 JumpTableEntryInfo[Idx] = std::make_pair(Size, PCRelSym);
478 }
479
481
482 const SetOfInstructions &getLOHRelated() const { return LOHRelated; }
483
484 // Shortcuts for LOH related types.
486 MCLOHType Kind;
487
488 /// Arguments of this directive. Order matters.
490
491 public:
493
495 : Kind(Kind), Args(Args.begin(), Args.end()) {
496 assert(isValidMCLOHType(Kind) && "Invalid LOH directive type!");
497 }
498
499 MCLOHType getKind() const { return Kind; }
500 LOHArgs getArgs() const { return Args; }
501 };
502
505
506 const MILOHContainer &getLOHContainer() const { return LOHContainerSet; }
507
508 /// Add a LOH directive of this @p Kind and this @p Args.
510 LOHContainerSet.push_back(MILOHDirective(Kind, Args));
511 LOHRelated.insert_range(Args);
512 }
513
514 size_t
516 size_t InitialSize = LOHContainerSet.size();
517 erase_if(LOHContainerSet, [&](const auto &D) {
518 return any_of(D.getArgs(), [&](auto *Arg) { return MIs.contains(Arg); });
519 });
520 // In theory there could be an LOH with one label in MIs and another label
521 // outside MIs, however we don't know if the label outside MIs is used in
522 // any other LOHs, so we can't remove them from LOHRelated. In that case, we
523 // might produce a few extra labels, but it won't break anything.
524 LOHRelated.remove_if([&](auto *MI) { return MIs.contains(MI); });
525 return InitialSize - LOHContainerSet.size();
526 };
527
529 return ForwardedMustTailRegParms;
530 }
531
532 std::optional<int> getTaggedBasePointerIndex() const {
533 return TaggedBasePointerIndex;
534 }
535 void setTaggedBasePointerIndex(int Index) { TaggedBasePointerIndex = Index; }
536
537 unsigned getTaggedBasePointerOffset() const {
538 return TaggedBasePointerOffset;
539 }
541 TaggedBasePointerOffset = Offset;
542 }
543
545 return CalleeSaveBaseToFrameRecordOffset;
546 }
548 CalleeSaveBaseToFrameRecordOffset = Offset;
549 }
550
551 bool shouldSignReturnAddress(const MachineFunction &MF) const;
552 bool shouldSignReturnAddress(bool SpillsLR) const;
553
555
556 bool shouldSignWithBKey() const { return SignWithBKey; }
557
558 bool hasELFSignedGOT() const { return HasELFSignedGOT; }
559
560 MCSymbol *getSigningInstrLabel() const { return SignInstrLabel; }
561 void setSigningInstrLabel(MCSymbol *Label) { SignInstrLabel = Label; }
562
563 bool isMTETagged() const { return IsMTETagged; }
564
565 bool branchTargetEnforcement() const { return BranchTargetEnforcement; }
566
567 bool branchProtectionPAuthLR() const { return BranchProtectionPAuthLR; }
568
569 void setHasSwiftAsyncContext(bool HasContext) {
570 HasSwiftAsyncContext = HasContext;
571 }
572 bool hasSwiftAsyncContext() const { return HasSwiftAsyncContext; }
573
575 SwiftAsyncContextFrameIdx = FI;
576 }
577 int getSwiftAsyncContextFrameIdx() const { return SwiftAsyncContextFrameIdx; }
578
579 bool needsDwarfUnwindInfo(const MachineFunction &MF) const;
580 bool needsAsyncDwarfUnwindInfo(const MachineFunction &MF) const;
581
582 bool hasStreamingModeChanges() const { return HasStreamingModeChanges; }
583 void setHasStreamingModeChanges(bool HasChanges) {
584 HasStreamingModeChanges = HasChanges;
585 }
586
587 bool hasStackProbing() const { return StackProbeSize != 0; }
588
589 int64_t getStackProbeSize() const { return StackProbeSize; }
590
591private:
592 // Hold the lists of LOHs.
593 MILOHContainer LOHContainerSet;
594 SetOfInstructions LOHRelated;
595
596 SmallVector<std::pair<unsigned, MCSymbol *>, 2> JumpTableEntryInfo;
597};
598
599namespace yaml {
601 std::optional<bool> HasRedZone;
602 std::optional<uint64_t> StackSizeSVE;
603
606
607 void mappingImpl(yaml::IO &YamlIO) override;
609};
610
612 static void mapping(IO &YamlIO, AArch64FunctionInfo &MFI) {
613 YamlIO.mapOptional("hasRedZone", MFI.HasRedZone);
614 YamlIO.mapOptional("stackSizeSVE", MFI.StackSizeSVE);
615 }
616};
617
618} // end namespace yaml
619
620} // end namespace llvm
621
622#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
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 setOutliningStyle(const std::string &Style)
const SetOfInstructions & getLOHRelated() const
void setBytesInStackArgArea(unsigned bytes)
void setSigningInstrLabel(MCSymbol *Label)
void setHasSwiftAsyncContext(bool HasContext)
std::optional< int > getTaggedBasePointerIndex() const
AArch64FunctionInfo(const Function &F, const AArch64Subtarget *STI)
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 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
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.
Representation of each machine instruction.
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...
bool contains(ConstPtrType Ptr) const
SmallPtrSet - This class implements a set which is optimized for holding SmallSize or less elements.
This class consists of common code factored out of the SmallVector class to reduce code duplication b...
This is a 'vector' (really, a variable-sized array), optimized for the case when the array is small.
void mapOptional(const char *Key, T &Val)
Definition YAMLTraits.h:810
This is an optimization pass for GlobalISel generic memory operations.
@ 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:1734
BumpPtrAllocatorImpl BumpPtrAllocator
The standard BumpPtrAllocator which just uses the default template parameters.
Definition Allocator.h:383
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:2122
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)
This class should be specialized by any type that needs to be converted to/from a YAML mapping.
Definition YAMLTraits.h:62