13 #ifndef LLVM_LIB_TARGET_AARCH64_AARCH64MACHINEFUNCTIONINFO_H 14 #define LLVM_LIB_TARGET_AARCH64_AARCH64MACHINEFUNCTIONINFO_H 43 unsigned BytesInStackArgArea = 0;
48 unsigned ArgumentStackToRestore = 0;
52 bool HasStackFrame =
false;
55 uint64_t LocalStackSize = 0;
58 int MinSVECSFrameIndex = 0;
59 int MaxSVECSFrameIndex = 0;
62 unsigned CalleeSavedStackSize = 0;
63 unsigned SVECalleeSavedStackSize = 0;
64 bool HasCalleeSavedStackSize =
false;
68 unsigned NumLocalDynamicTLSAccesses = 0;
72 int VarArgsStackIndex = 0;
76 int VarArgsGPRIndex = 0;
80 unsigned VarArgsGPRSize = 0;
84 int VarArgsFPRIndex = 0;
88 unsigned VarArgsFPRSize = 0;
92 bool IsSplitCSR =
false;
96 bool StackRealigned =
false;
100 bool CalleeSaveStackHasFreeSpace =
false;
105 unsigned SRetReturnReg = 0;
109 uint64_t StackSizeSVE = 0;
112 bool HasCalculatedStackSizeSVE =
false;
127 unsigned TaggedBasePointerOffset = 0;
146 ArgumentStackToRestore = bytes;
152 HasCalculatedStackSizeSVE =
true;
165 return CalleeSaveStackHasFreeSpace;
168 CalleeSaveStackHasFreeSpace = s;
177 CalleeSavedStackSize =
Size;
178 HasCalleeSavedStackSize =
true;
187 bool ValidateCalleeSavedStackSize =
false;
193 ValidateCalleeSavedStackSize = HasCalleeSavedStackSize;
196 if (!HasCalleeSavedStackSize || ValidateCalleeSavedStackSize) {
202 int64_t MaxOffset = std::numeric_limits<int64_t>::min();
204 int FrameIdx =
Info.getFrameIdx();
209 MinOffset = std::min<int64_t>(
Offset, MinOffset);
210 MaxOffset = std::max<int64_t>(Offset + ObjSize, MaxOffset);
213 unsigned Size =
alignTo(MaxOffset - MinOffset, 16);
215 "Invalid size calculated for callee saves");
223 assert(HasCalleeSavedStackSize &&
224 "CalleeSavedStackSize has not been calculated");
225 return CalleeSavedStackSize;
230 SVECalleeSavedStackSize =
Size;
233 return SVECalleeSavedStackSize;
237 MinSVECSFrameIndex = Min;
238 MaxSVECSFrameIndex = Max;
246 return NumLocalDynamicTLSAccesses;
271 auto It = JumpTableEntryInfo.find(Idx);
272 if (It != JumpTableEntryInfo.end())
273 return It->second.first;
277 return JumpTableEntryInfo.find(Idx)->second.second;
280 JumpTableEntryInfo[Idx] = std::make_pair(Size, PCRelSym);
298 : Kind(Kind), Args(Args.
begin(), Args.
end()) {
314 LOHRelated.insert(Args.
begin(), Args.
end());
318 return ForwardedMustTailRegParms;
322 return TaggedBasePointerOffset;
325 TaggedBasePointerOffset =
Offset;
338 #endif // LLVM_LIB_TARGET_AARCH64_AARCH64MACHINEFUNCTIONINFO_H const_iterator end(StringRef path)
Get end iterator over path.
bool isCalleeSavedInfoValid() const
Has the callee saved info been calculated yet?
AArch64FunctionInfo - This class is derived from MachineFunctionInfo and contains private AArch64-spe...
const_iterator begin(StringRef path, Style style=Style::native)
Get begin iterator over path.
void setVarArgsGPRSize(unsigned Size)
This class represents lattice values for constants.
unsigned getNumLocalDynamicTLSAccesses() const
MCSymbol - Instances of this class represent a symbol name in the MC file, and MCSymbols are created ...
uint64_t getLocalStackSize() const
int getVarArgsStackIndex() const
void setVarArgsStackIndex(int Index)
unsigned getJumpTableEntrySize(int Idx) const
const SetOfInstructions & getLOHRelated() const
MCLOHType getKind() const
void setVarArgsFPRIndex(int Index)
bool hasFnAttribute(Attribute::AttrKind Kind) const
Return true if the function has the attribute.
void setVarArgsFPRSize(unsigned Size)
MachineFunctionInfo - This class can be derived from and used by targets to hold private target-speci...
int getVarArgsGPRIndex() const
bool isStackRealigned() const
void setHasRedZone(bool s)
This class consists of common code factored out of the SmallVector class to reduce code duplication b...
int64_t getObjectOffset(int ObjectIdx) const
Return the assigned stack offset of the specified object from the incoming stack pointer.
void setLocalStackSize(uint64_t Size)
The MachineFrameInfo class represents an abstract stack frame until prolog/epilog code is inserted...
unsigned getArgumentStackToRestore() const
void setArgumentStackToRestore(unsigned bytes)
AArch64FunctionInfo(MachineFunction &MF)
unsigned getSRetReturnReg() const
ArrayRef - Represent a constant reference to an array (0 or more elements consecutively in memory)...
int64_t getObjectSize(int ObjectIdx) const
Return the size of the specified object.
Analysis containing CSE Info
uint64_t getStackSizeSVE() const
unsigned getCalleeSavedStackSize() const
AArch64FunctionInfo()=default
void setJumpTableEntryInfo(int Idx, unsigned Size, MCSymbol *PCRelSym)
void incNumLocalDynamicTLSAccesses()
void setStackSizeSVE(uint64_t S)
unsigned getVarArgsGPRSize() const
unsigned getVarArgsFPRSize() const
MILOHDirective(MCLOHType Kind, LOHArgs Args)
void setCalleeSaveStackHasFreeSpace(bool s)
MCLOHType
Linker Optimization Hint Type.
void setSRetReturnReg(unsigned Reg)
void setVarArgsGPRIndex(int Index)
SmallVectorImpl< ForwardedRegister > & getForwardedMustTailRegParms()
MCSymbol * getJumpTableEntryPCRelSymbol(int Idx) const
void setHasStackFrame(bool s)
ArrayRef< const MachineInstr * > LOHArgs
unsigned getCalleeSavedStackSize(const MachineFrameInfo &MFI) const
unsigned getBytesInStackArgArea() const
Align max(MaybeAlign Lhs, Align Rhs)
This is a 'vector' (really, a variable-sized array), optimized for the case when the array is small...
void setStackRealigned(bool s)
bool hasCalleeSaveStackFreeSpace() const
const Function & getFunction() const
Return the LLVM function that this machine code represents.
Optional< bool > hasRedZone() const
const MILOHContainer & getLOHContainer() const
uint64_t alignTo(uint64_t Size, Align A)
Returns a multiple of A needed to store Size bytes.
void setMinMaxSVECSFrameIndex(int Min, int Max)
const std::vector< CalleeSavedInfo > & getCalleeSavedInfo() const
Returns a reference to call saved info vector for the current function.
static bool isValidMCLOHType(unsigned Kind)
unsigned getTaggedBasePointerOffset() const
void setBytesInStackArgArea(unsigned bytes)
uint8_t getStackID(int ObjectIdx) const
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
void addLOHDirective(MCLOHType Kind, MILOHArgs Args)
Add a LOH directive of this Kind and this Args.
int getMinSVECSFrameIndex() const
void setSVECalleeSavedStackSize(unsigned Size)
int getVarArgsFPRIndex() const
bool hasStackFrame() const
void setTaggedBasePointerOffset(unsigned Offset)
unsigned getSVECalleeSavedStackSize() const
bool hasCalculatedStackSizeSVE() const
void setCalleeSavedStackSize(unsigned Size)
int getMaxSVECSFrameIndex() const
void setIsSplitCSR(bool s)