13#ifndef LLVM_LIB_TARGET_X86_X86MACHINEFUNCTIONINFO_H
14#define LLVM_LIB_TARGET_X86_X86MACHINEFUNCTIONINFO_H
28class X86MachineFunctionInfo;
33 YamlIO.enumCase(
Value,
"None", AMXProgModelEnum::None);
34 YamlIO.enumCase(
Value,
"DirectReg", AMXProgModelEnum::DirectReg);
35 YamlIO.enumCase(
Value,
"ManagedRA", AMXProgModelEnum::ManagedRA);
59 virtual void anchor();
65 bool ForceFramePointer =
false;
71 signed char RestoreBasePointerOffset = 0;
79 unsigned CalleeSavedFrameSize = 0;
84 unsigned BytesToPopOnReturn = 0;
87 int ReturnAddrIndex = 0;
90 int FrameAddrIndex = 0;
94 int TailCallReturnAddrDelta = 0;
107 int VarArgsFrameIndex = 0;
109 int RegSaveFrameIndex = 0;
111 unsigned VarArgsGPOffset = 0;
113 unsigned VarArgsFPOffset = 0;
116 unsigned ArgumentStackSize = 0;
118 unsigned NumLocalDynamics = 0;
121 bool HasPushSequences =
false;
125 bool HasSEHFramePtrSave =
false;
129 int SEHFramePtrSaveIndex = 0;
136 bool IsSplitCSR =
false;
139 bool UsesRedZone =
false;
142 bool HasDynAlloca =
false;
145 bool HasPreallocatedCall =
false;
150 bool HasSwiftAsyncContext =
false;
153 bool PadForPush2Pop2 =
false;
156 std::set<Register> CandidatesForPush2Pop2;
161 bool HasCFIAdjustCfa =
false;
165 std::optional<int> SwiftAsyncContextFrameIdx;
174 bool FPClobberedByCall =
false;
175 bool BPClobberedByCall =
false;
204 RestoreBasePointerOffset = -CalleeSavedFrameSize;
210 return WinEHXMMSlotInfo; }
262 "mixed model is not supported");
263 AMXProgModel = Model;
267 return ForwardedMustTailRegParms;
289 return CandidatesForPush2Pop2.find(
Reg) != CandidatesForPush2Pop2.end();
292 CandidatesForPush2Pop2.insert(
Reg);
295 return CandidatesForPush2Pop2.size();
305 return SwiftAsyncContextFrameIdx;
310 auto Insert = PreallocatedIds.
insert({CS, PreallocatedIds.
size()});
315 return Insert.first->second;
319 PreallocatedStackSizes[Id] = StackSize;
323 assert(PreallocatedStackSizes[Id] != 0 &&
"stack size not set");
324 return PreallocatedStackSizes[Id];
332 assert(!PreallocatedArgOffsets[Id].empty() &&
"arg offsets not set");
333 return PreallocatedArgOffsets[Id];
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 SmallVector class.
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.
std::pair< iterator, bool > insert(const std::pair< KeyT, ValueT > &KV)
Representation of each machine instruction.
Wrapper class representing virtual and physical registers.
This class consists of common code factored out of the SmallVector class to reduce code duplication b...
void assign(size_type NumElts, ValueParamT Elt)
reference emplace_back(ArgTypes &&... Args)
void push_back(const T &Elt)
This is a 'vector' (really, a variable-sized array), optimized for the case when the array is small.
TargetSubtargetInfo - Generic base class for all target subtargets.
LLVM Value Representation.
X86MachineFunctionInfo - This class is derived from MachineFunction and contains private X86 target-s...
void setBytesToPopOnReturn(unsigned bytes)
bool getForceFramePointer() const
void setFAIndex(int Index)
bool hasDynAlloca() const
void setHasCFIAdjustCfa(bool v)
void setPadForPush2Pop2(bool V)
const DenseMap< int, unsigned > & getWinEHXMMSlotInfo() const
void setAMXProgModel(AMXProgModelEnum Model)
void setBPClobberedByCall(bool C)
void setSwiftAsyncContextFrameIdx(int v)
void setFPClobberedByCall(bool C)
unsigned getVarArgsGPOffset() const
bool isCandidateForPush2Pop2(Register Reg) const
unsigned getArgumentStackSize() const
X86MachineFunctionInfo(const X86MachineFunctionInfo &)=default
int getRegSaveFrameIndex() const
ArrayRef< size_t > getPreallocatedArgOffsets(const size_t Id)
void setHasSwiftAsyncContext(bool v)
Register getSRetReturnReg() const
void setIsSplitCSR(bool s)
void setVarArgsGPOffset(unsigned Offset)
void setRegSaveFrameIndex(int Idx)
bool getFPClobberedByCall() const
void setForceFramePointer(bool forceFP)
Register getGlobalBaseReg() const
void setSRetReturnReg(Register Reg)
unsigned getVarArgsFPOffset() const
void setHasDynAlloca(bool v)
int getRestoreBasePointerOffset() const
void setArgumentStackSize(unsigned size)
X86MachineFunctionInfo(const Function &F, const TargetSubtargetInfo *STI)
X86MachineFunctionInfo()=default
void setPreallocatedArgOffsets(size_t Id, ArrayRef< size_t > AO)
void setRestoreBasePointer(unsigned CalleeSavedFrameSize)
int getSEHFramePtrSaveIndex() const
SmallVectorImpl< ForwardedRegister > & getForwardedMustTailRegParms()
void setTCReturnAddrDelta(int delta)
bool hasCFIAdjustCfa() const
int getVarArgsFrameIndex() const
int getTCReturnAddrDelta() const
void setRestoreBasePointer(const MachineFunction *MF)
std::optional< int > getSwiftAsyncContextFrameIdx() const
bool getHasSEHFramePtrSave() const
void setHasPreallocatedCall(bool v)
void incNumLocalDynamicTLSAccesses()
size_t getPreallocatedStackSize(const size_t Id)
void setGlobalBaseReg(Register Reg)
unsigned getNumLocalDynamicTLSAccesses() const
void setPreallocatedStackSize(size_t Id, size_t StackSize)
void setVarArgsFrameIndex(int Idx)
DenseMap< int, unsigned > & getWinEHXMMSlotInfo()
bool getBPClobberedByCall() const
void setUsesRedZone(bool V)
bool hasPreallocatedCall() const
bool hasSwiftAsyncContext() const
void setHasSEHFramePtrSave(bool V)
bool getRestoreBasePointer() const
MachineInstr * getStackPtrSaveMI() const
size_t getNumCandidatesForPush2Pop2() 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 initializeBaseYamlFields(const yaml::X86MachineFunctionInfo &YamlMFI)
unsigned getBytesToPopOnReturn() const
AMXProgModelEnum getAMXProgModel() const
void setVarArgsFPOffset(unsigned Offset)
void addCandidateForPush2Pop2(Register Reg)
unsigned getCalleeSavedFrameSize() const
bool getHasPushSequences() const
bool padForPush2Pop2() const
void setStackPtrSaveMI(MachineInstr *MI)
bool getUsesRedZone() const
void setCalleeSavedFrameSize(unsigned bytes)
void setRAIndex(int Index)
void setSEHFramePtrSaveIndex(int Index)
size_t getPreallocatedIdForCallSite(const Value *CS)
void setHasPushSequences(bool HasPush)
@ C
The default llvm calling convention, compatible with C.
This is an optimization pass for GlobalISel generic memory operations.
auto size(R &&Range, std::enable_if_t< std::is_base_of< std::random_access_iterator_tag, typename std::iterator_traits< decltype(Range.begin())>::iterator_category >::value, void > *=nullptr)
Get the size of a range.
MachineFunctionInfo - This class can be derived from and used by targets to hold private target-speci...
Targets should override this in a way that mirrors the implementation of llvm::MachineFunctionInfo.
static void mapping(IO &YamlIO, X86MachineFunctionInfo &MFI)
static void enumeration(IO &YamlIO, AMXProgModelEnum &Value)
AMXProgModelEnum AMXProgModel
void mappingImpl(yaml::IO &YamlIO) override
~X86MachineFunctionInfo()=default
X86MachineFunctionInfo()=default