Go to the documentation of this file.
13 #ifndef LLVM_LIB_TARGET_AARCH64_AARCH64MACHINEFUNCTIONINFO_H
14 #define LLVM_LIB_TARGET_AARCH64_AARCH64MACHINEFUNCTIONINFO_H
31 struct AArch64FunctionInfo;
51 unsigned BytesInStackArgArea = 0;
56 unsigned ArgumentStackToRestore = 0;
62 unsigned TailCallReservedStack = 0;
66 bool HasStackFrame =
false;
72 int MinSVECSFrameIndex = 0;
73 int MaxSVECSFrameIndex = 0;
76 unsigned CalleeSavedStackSize = 0;
77 unsigned SVECalleeSavedStackSize = 0;
78 bool HasCalleeSavedStackSize =
false;
82 unsigned NumLocalDynamicTLSAccesses = 0;
86 int VarArgsStackIndex = 0;
90 int VarArgsGPRIndex = 0;
94 unsigned VarArgsGPRSize = 0;
98 int VarArgsFPRIndex = 0;
102 unsigned VarArgsFPRSize = 0;
106 bool IsSplitCSR =
false;
110 bool StackRealigned =
false;
114 bool CalleeSaveStackHasFreeSpace =
false;
127 bool HasCalculatedStackSizeSVE =
false;
145 unsigned TaggedBasePointerOffset;
153 int CalleeSaveBaseToFrameRecordOffset = 0;
157 bool SignReturnAddress =
false;
161 bool SignReturnAddressAll =
false;
164 bool SignWithBKey =
false;
168 bool BranchTargetEnforcement =
false;
173 bool HasSwiftAsyncContext =
false;
178 bool IsMTETagged =
false;
182 bool IsSVECC =
false;
208 ArgumentStackToRestore = bytes;
213 TailCallReservedStack = bytes;
219 HasCalculatedStackSizeSVE =
true;
232 return CalleeSaveStackHasFreeSpace;
235 CalleeSaveStackHasFreeSpace =
s;
247 CalleeSavedStackSize = Size;
248 HasCalleeSavedStackSize =
true;
257 bool ValidateCalleeSavedStackSize =
false;
263 ValidateCalleeSavedStackSize = HasCalleeSavedStackSize;
266 if (!HasCalleeSavedStackSize || ValidateCalleeSavedStackSize) {
274 int FrameIdx =
Info.getFrameIdx();
279 MinOffset = std::min<int64_t>(Offset, MinOffset);
280 MaxOffset = std::max<int64_t>(Offset + ObjSize, MaxOffset);
286 MinOffset = std::min<int64_t>(Offset, MinOffset);
287 MaxOffset = std::max<int64_t>(Offset + ObjSize, MaxOffset);
290 unsigned Size =
alignTo(MaxOffset - MinOffset, 16);
292 "Invalid size calculated for callee saves");
300 assert(HasCalleeSavedStackSize &&
301 "CalleeSavedStackSize has not been calculated");
302 return CalleeSavedStackSize;
307 SVECalleeSavedStackSize = Size;
310 return SVECalleeSavedStackSize;
314 MinSVECSFrameIndex = Min;
315 MaxSVECSFrameIndex = Max;
323 return NumLocalDynamicTLSAccesses;
348 return JumpTableEntryInfo[Idx].first;
351 return JumpTableEntryInfo[Idx].second;
354 if ((
unsigned)Idx >= JumpTableEntryInfo.size())
355 JumpTableEntryInfo.resize(Idx+1);
356 JumpTableEntryInfo[Idx] = std::make_pair(Size, PCRelSym);
374 : Kind(Kind), Args(Args.
begin(), Args.
end()) {
394 return ForwardedMustTailRegParms;
398 return TaggedBasePointerIndex;
403 return TaggedBasePointerOffset;
406 TaggedBasePointerOffset = Offset;
410 return CalleeSaveBaseToFrameRecordOffset;
413 CalleeSaveBaseToFrameRecordOffset = Offset;
425 HasSwiftAsyncContext = HasContext;
430 SwiftAsyncContextFrameIdx = FI;
466 #endif // LLVM_LIB_TARGET_AARCH64_AARCH64MACHINEFUNCTIONINFO_H
uint64_t alignTo(uint64_t Size, Align A)
Returns a multiple of A needed to store Size bytes.
void setArgumentStackToRestore(unsigned bytes)
~AArch64FunctionInfo()=default
This is an optimization pass for GlobalISel generic memory operations.
MCSymbol - Instances of this class represent a symbol name in the MC file, and MCSymbols are created ...
int getVarArgsFPRIndex() const
MCSymbol * getJumpTableEntryPCRelSymbol(int Idx) const
Optional< bool > hasRedZone() const
void mappingImpl(yaml::IO &YamlIO) override
MCLOHType
Linker Optimization Hint Type.
Targets should override this in a way that mirrors the implementation of llvm::MachineFunctionInfo.
int getMaxSVECSFrameIndex() const
This is a 'vector' (really, a variable-sized array), optimized for the case when the array is small.
Reg
All possible values of the reg field in the ModR/M byte.
Optional< int > getTaggedBasePointerIndex() const
void setSwiftAsyncContextFrameIdx(int FI)
const_iterator end(StringRef path)
Get end iterator over path.
const_iterator begin(StringRef path, Style style=Style::native)
Get begin iterator over path.
void setTaggedBasePointerIndex(int Index)
Expected< ExpressionValue > max(const ExpressionValue &Lhs, const ExpressionValue &Rhs)
void setVarArgsStackIndex(int Index)
void setTaggedBasePointerOffset(unsigned Offset)
const SetOfInstructions & getLOHRelated() const
unsigned getJumpTableEntrySize(int Idx) const
void setHasSwiftAsyncContext(bool HasContext)
static void mapping(IO &YamlIO, AArch64FunctionInfo &MFI)
MachineFunctionInfo * clone(BumpPtrAllocator &Allocator, MachineFunction &DestMF, const DenseMap< MachineBasicBlock *, MachineBasicBlock * > &Src2DstMBB) const override
Make a functionally equivalent copy of this MachineFunctionInfo in MF.
SmallVector< MILOHDirective, 32 > MILOHContainer
unsigned getBytesInStackArgArea() const
bool isStackRealigned() const
void setVarArgsFPRSize(unsigned Size)
void setHasRedZone(bool s)
void setBytesInStackArgArea(unsigned bytes)
unsigned getNumLocalDynamicTLSAccesses() const
static bool isValidMCLOHType(unsigned Kind)
uint8_t getStackID(int ObjectIdx) const
void incNumLocalDynamicTLSAccesses()
bool shouldSignReturnAddress() const
void setSRetReturnReg(unsigned Reg)
int getVarArgsStackIndex() const
bool needsAsyncDwarfUnwindInfo() const
int64_t getObjectOffset(int ObjectIdx) const
Return the assigned stack offset of the specified object from the incoming stack pointer.
Analysis containing CSE Info
AArch64FunctionInfo(MachineFunction &MF)
bool hasStackFrame() const
bool isCalleeSavedInfoValid() const
Has the callee saved info been calculated yet?
bool shouldSignWithBKey() const
void setOutliningStyle(std::string Style)
void setVarArgsFPRIndex(int Index)
int getCalleeSaveBaseToFrameRecordOffset() const
SmallPtrSet< const MachineInstr *, 16 > SetOfInstructions
int64_t getObjectSize(int ObjectIdx) const
Return the size of the specified object.
unsigned getTaggedBasePointerOffset() const
multiplies can be turned into SHL s
Allocate memory in an ever growing pool, as if by bump-pointer.
AArch64FunctionInfo()=default
bool needsDwarfUnwindInfo() const
MCLOHType getKind() const
void setCalleeSaveBaseToFrameRecordOffset(int Offset)
int getVarArgsGPRIndex() const
AArch64FunctionInfo - This class is derived from MachineFunctionInfo and contains private AArch64-spe...
ArrayRef< const MachineInstr * > LOHArgs
void setCalleeSaveStackHasFreeSpace(bool s)
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
uint64_t getLocalStackSize() const
void setStackRealigned(bool s)
bool branchTargetEnforcement() const
void setSVECalleeSavedStackSize(unsigned Size)
unsigned getVarArgsGPRSize() const
unsigned getVarArgsFPRSize() const
const std::vector< CalleeSavedInfo > & getCalleeSavedInfo() const
Returns a reference to call saved info vector for the current function.
ArrayRef - Represent a constant reference to an array (0 or more elements consecutively in memory),...
Expected< ExpressionValue > min(const ExpressionValue &Lhs, const ExpressionValue &Rhs)
int getSwiftAsyncContextFrameIdx() const
bool hasCalculatedStackSizeSVE() const
const MILOHContainer & getLOHContainer() const
void setVarArgsGPRIndex(int Index)
SmallVectorImpl< ForwardedRegister > & getForwardedMustTailRegParms()
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
unsigned getTailCallReservedStack() const
void setMinMaxSVECSFrameIndex(int Min, int Max)
Wrapper class representing virtual and physical registers.
bool hasCalleeSaveStackFreeSpace() const
MILOHDirective(MCLOHType Kind, LOHArgs Args)
uint64_t getStackSizeSVE() const
void initializeBaseYamlFields(const yaml::AArch64FunctionInfo &YamlMFI)
unsigned getCalleeSavedStackSize() const
int getMinSVECSFrameIndex() const
void setLocalStackSize(uint64_t Size)
void setJumpTableEntryInfo(int Idx, unsigned Size, MCSymbol *PCRelSym)
unsigned getSVECalleeSavedStackSize() const
unsigned getArgumentStackToRestore() const
The MachineFrameInfo class represents an abstract stack frame until prolog/epilog code is inserted.
unsigned getSRetReturnReg() const
bool hasSwiftAsyncContext() const
Optional< bool > HasRedZone
Optional< std::string > getOutliningStyle() const
void setHasStackFrame(bool s)
unsigned getCalleeSavedStackSize(const MachineFrameInfo &MFI) const
This class consists of common code factored out of the SmallVector class to reduce code duplication b...
void setCalleeSavedStackSize(unsigned Size)
void setIsSplitCSR(bool s)
constexpr char Args[]
Key for Kernel::Metadata::mArgs.
MachineFunctionInfo - This class can be derived from and used by targets to hold private target-speci...
void addLOHDirective(MCLOHType Kind, MILOHArgs Args)
Add a LOH directive of this Kind and this Args.
void setTailCallReservedStack(unsigned bytes)
void setStackSizeSVE(uint64_t S)
void setVarArgsGPRSize(unsigned Size)
std::pair< iterator, bool > insert(PtrType Ptr)
Inserts Ptr if and only if there is no element in the container equal to Ptr.