13#ifndef LLVM_LIB_TARGET_AARCH64_AARCH64MACHINEFUNCTIONINFO_H
14#define LLVM_LIB_TARGET_AARCH64_AARCH64MACHINEFUNCTIONINFO_H
31struct AArch64FunctionInfo;
34class AArch64Subtarget;
49 unsigned BytesInStackArgArea = 0;
54 unsigned ArgumentStackToRestore = 0;
60 unsigned TailCallReservedStack = 0;
64 bool HasStackFrame =
false;
70 int MinSVECSFrameIndex = 0;
71 int MaxSVECSFrameIndex = 0;
74 unsigned CalleeSavedStackSize = 0;
75 unsigned SVECalleeSavedStackSize = 0;
76 bool HasCalleeSavedStackSize =
false;
80 unsigned NumLocalDynamicTLSAccesses = 0;
84 int VarArgsStackIndex = 0;
87 unsigned VarArgsStackOffset = 0;
91 int VarArgsGPRIndex = 0;
95 unsigned VarArgsGPRSize = 0;
99 int VarArgsFPRIndex = 0;
103 unsigned VarArgsFPRSize = 0;
107 bool IsSplitCSR =
false;
111 bool StackRealigned =
false;
115 bool CalleeSaveStackHasFreeSpace =
false;
128 bool HasCalculatedStackSizeSVE =
false;
134 std::optional<bool> HasRedZone;
141 std::optional<int> TaggedBasePointerIndex;
146 unsigned TaggedBasePointerOffset;
150 std::optional<std::string> OutliningStyle;
154 int CalleeSaveBaseToFrameRecordOffset = 0;
158 bool SignReturnAddress =
false;
162 bool SignReturnAddressAll =
false;
165 bool SignWithBKey =
false;
169 bool BranchTargetEnforcement =
false;
174 bool HasSwiftAsyncContext =
false;
177 int SwiftAsyncContextFrameIdx = std::numeric_limits<int>::max();
179 bool IsMTETagged =
false;
183 bool IsSVECC =
false;
189 bool HasStreamingModeChanges =
false;
192 mutable std::optional<bool> NeedsDwarfUnwindInfo;
195 mutable std::optional<bool> NeedsAsyncDwarfUnwindInfo;
218 ArgumentStackToRestore = bytes;
223 TailCallReservedStack = bytes;
229 HasCalculatedStackSizeSVE =
true;
242 return CalleeSaveStackHasFreeSpace;
245 CalleeSaveStackHasFreeSpace = s;
255 return OutliningStyle;
259 CalleeSavedStackSize =
Size;
260 HasCalleeSavedStackSize =
true;
269 bool ValidateCalleeSavedStackSize =
false;
275 ValidateCalleeSavedStackSize = HasCalleeSavedStackSize;
278 if (!HasCalleeSavedStackSize || ValidateCalleeSavedStackSize) {
283 int64_t MinOffset = std::numeric_limits<int64_t>::max();
284 int64_t MaxOffset = std::numeric_limits<int64_t>::min();
286 int FrameIdx =
Info.getFrameIdx();
291 MinOffset = std::min<int64_t>(
Offset, MinOffset);
292 MaxOffset = std::max<int64_t>(
Offset + ObjSize, MaxOffset);
295 if (SwiftAsyncContextFrameIdx != std::numeric_limits<int>::max()) {
298 MinOffset = std::min<int64_t>(
Offset, MinOffset);
299 MaxOffset = std::max<int64_t>(
Offset + ObjSize, MaxOffset);
302 unsigned Size =
alignTo(MaxOffset - MinOffset, 16);
304 "Invalid size calculated for callee saves");
312 assert(HasCalleeSavedStackSize &&
313 "CalleeSavedStackSize has not been calculated");
314 return CalleeSavedStackSize;
319 SVECalleeSavedStackSize =
Size;
322 return SVECalleeSavedStackSize;
326 MinSVECSFrameIndex = Min;
327 MaxSVECSFrameIndex = Max;
335 return NumLocalDynamicTLSAccesses;
338 std::optional<bool>
hasRedZone()
const {
return HasRedZone; }
363 return JumpTableEntryInfo[
Idx].first;
366 return JumpTableEntryInfo[
Idx].second;
369 if ((
unsigned)
Idx >= JumpTableEntryInfo.size())
370 JumpTableEntryInfo.resize(
Idx+1);
371 JumpTableEntryInfo[
Idx] = std::make_pair(
Size, PCRelSym);
389 : Kind(Kind), Args(Args.begin(), Args.end()) {
405 LOHRelated.
insert(Args.begin(), Args.end());
409 return ForwardedMustTailRegParms;
413 return TaggedBasePointerIndex;
418 return TaggedBasePointerOffset;
421 TaggedBasePointerOffset =
Offset;
425 return CalleeSaveBaseToFrameRecordOffset;
428 CalleeSaveBaseToFrameRecordOffset =
Offset;
440 HasSwiftAsyncContext = HasContext;
445 SwiftAsyncContextFrameIdx = FI;
454 HasStreamingModeChanges = HasChanges;
Analysis containing CSE Info
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
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
This file defines the SmallPtrSet class.
This file defines the SmallVector class.
MILOHDirective(MCLOHType Kind, LOHArgs Args)
MCLOHType getKind() const
ArrayRef< const MachineInstr * > LOHArgs
AArch64FunctionInfo - This class is derived from MachineFunctionInfo and contains private AArch64-spe...
unsigned getLazySaveTPIDR2Obj() const
void addLOHDirective(MCLOHType Kind, MILOHArgs Args)
Add a LOH directive of this Kind and this Args.
bool branchTargetEnforcement() const
void setHasStackFrame(bool s)
void setSwiftAsyncContextFrameIdx(int FI)
unsigned getTailCallReservedStack() const
unsigned getCalleeSavedStackSize(const MachineFrameInfo &MFI) const
unsigned getVarArgsFPRSize() const
void setCalleeSaveBaseToFrameRecordOffset(int Offset)
void setVarArgsStackOffset(unsigned Offset)
void setVarArgsStackIndex(int Index)
unsigned getArgumentStackToRestore() const
void setTailCallReservedStack(unsigned bytes)
SmallVector< MILOHDirective, 32 > MILOHContainer
void setLocalStackSize(uint64_t Size)
void setCalleeSaveStackHasFreeSpace(bool s)
int getCalleeSaveBaseToFrameRecordOffset() const
SmallVectorImpl< ForwardedRegister > & getForwardedMustTailRegParms()
int getMaxSVECSFrameIndex() const
void setIsSplitCSR(bool s)
int getVarArgsFPRIndex() const
bool hasStreamingModeChanges() const
bool shouldSignReturnAddress(const MachineFunction &MF) const
void incNumLocalDynamicTLSAccesses()
const SetOfInstructions & getLOHRelated() const
void setBytesInStackArgArea(unsigned bytes)
int getVarArgsStackIndex() const
void setVarArgsGPRIndex(int Index)
unsigned getTaggedBasePointerOffset() const
void setCalleeSavedStackSize(unsigned Size)
int getVarArgsGPRIndex() const
uint64_t getStackSizeSVE() const
void setHasSwiftAsyncContext(bool HasContext)
void setHasRedZone(bool s)
bool hasStackFrame() const
void setVarArgsFPRSize(unsigned Size)
std::optional< int > getTaggedBasePointerIndex() const
unsigned getVarArgsStackOffset() const
void setLazySaveTPIDR2Obj(unsigned Reg)
uint64_t getLocalStackSize() const
void setStackRealigned(bool s)
unsigned getJumpTableEntrySize(int Idx) const
bool needsDwarfUnwindInfo(const MachineFunction &MF) const
void setOutliningStyle(std::string Style)
unsigned getVarArgsGPRSize() const
unsigned getSRetReturnReg() const
void setStackSizeSVE(uint64_t S)
MCSymbol * getJumpTableEntryPCRelSymbol(int Idx) const
bool isStackRealigned() const
unsigned getNumLocalDynamicTLSAccesses() const
SmallPtrSet< const MachineInstr *, 16 > SetOfInstructions
bool hasSwiftAsyncContext() const
void setTaggedBasePointerOffset(unsigned Offset)
std::optional< bool > hasRedZone() const
void setSRetReturnReg(unsigned Reg)
int getSwiftAsyncContextFrameIdx() const
bool hasCalculatedStackSizeSVE() const
void setSVECalleeSavedStackSize(unsigned Size)
std::optional< std::string > getOutliningStyle() const
unsigned getBytesInStackArgArea() const
void initializeBaseYamlFields(const yaml::AArch64FunctionInfo &YamlMFI)
const MILOHContainer & getLOHContainer() const
void setJumpTableEntryInfo(int Idx, unsigned Size, MCSymbol *PCRelSym)
unsigned getSVECalleeSavedStackSize() const
int getMinSVECSFrameIndex() const
bool needsAsyncDwarfUnwindInfo(const MachineFunction &MF) const
void setVarArgsFPRIndex(int Index)
MachineFunctionInfo * clone(BumpPtrAllocator &Allocator, MachineFunction &DestMF, const DenseMap< MachineBasicBlock *, MachineBasicBlock * > &Src2DstMBB) const override
Make a functionally equivalent copy of this MachineFunctionInfo in MF.
void setVarArgsGPRSize(unsigned Size)
void setTaggedBasePointerIndex(int Index)
void setArgumentStackToRestore(unsigned bytes)
void setMinMaxSVECSFrameIndex(int Min, int Max)
void setHasStreamingModeChanges(bool HasChanges)
unsigned getCalleeSavedStackSize() const
bool hasCalleeSaveStackFreeSpace() const
bool shouldSignWithBKey() const
ArrayRef - Represent a constant reference to an array (0 or more elements consecutively in memory),...
Allocate memory in an ever growing pool, as if by bump-pointer.
MCSymbol - Instances of this class represent a symbol name in the MC file, and MCSymbols are created ...
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.
std::pair< iterator, bool > insert(PtrType Ptr)
Inserts Ptr if and only if there is no element in the container equal to Ptr.
This class consists of common code factored out of the SmallVector class to reduce code duplication b...
void push_back(const T &Elt)
This is a 'vector' (really, a variable-sized array), optimized for the case when the array is small.
This is an optimization pass for GlobalISel generic memory operations.
static bool isValidMCLOHType(unsigned Kind)
MCLOHType
Linker Optimization Hint Type.
uint64_t alignTo(uint64_t Size, Align A)
Returns a multiple of A needed to store Size bytes.
MachineFunctionInfo - This class can be derived from and used by targets to hold private target-speci...
std::optional< bool > HasRedZone
~AArch64FunctionInfo()=default
AArch64FunctionInfo()=default
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)