13#ifndef LLVM_LIB_TARGET_X86_X86MACHINEFUNCTIONINFO_H
14#define LLVM_LIB_TARGET_X86_X86MACHINEFUNCTIONINFO_H
29class X86MachineFunctionInfo;
72 virtual void anchor();
78 bool ForceFramePointer =
false;
84 signed char RestoreBasePointerOffset = 0;
92 unsigned CalleeSavedFrameSize = 0;
97 unsigned BytesToPopOnReturn = 0;
100 int ReturnAddrIndex = 0;
103 int FrameAddrIndex = 0;
107 int TailCallReturnAddrDelta = 0;
120 int VarArgsFrameIndex = 0;
122 int RegSaveFrameIndex = 0;
124 unsigned VarArgsGPOffset = 0;
126 unsigned VarArgsFPOffset = 0;
129 unsigned ArgumentStackSize = 0;
131 unsigned NumLocalDynamics = 0;
134 bool HasPushSequences =
false;
137 bool HasVAStartSaveXMMRegs =
false;
141 bool HasSEHFramePtrSave =
false;
145 int SEHFramePtrSaveIndex = 0;
154 bool ReportedACEProgModelMix =
false;
158 bool IsSplitCSR =
false;
161 bool UsesRedZone =
false;
164 bool HasDynAlloca =
false;
167 bool HasPreallocatedCall =
false;
172 bool HasSwiftAsyncContext =
false;
175 std::set<Register> CandidatesForPush2Pop2;
180 bool HasCFIAdjustCfa =
false;
184 std::optional<int> SwiftAsyncContextFrameIdx;
193 bool FPClobberedByCall =
false;
194 bool BPClobberedByCall =
false;
195 bool FPClobberedByInvoke =
false;
196 bool BPClobberedByInvoke =
false;
228 RestoreBasePointerOffset = -CalleeSavedFrameSize;
234 return WinEHXMMSlotInfo; }
284 "mixed model is not supported");
285 AMXProgModel = Model;
294 return ForwardedMustTailRegParms;
313 return CandidatesForPush2Pop2.find(
Reg) != CandidatesForPush2Pop2.end();
316 CandidatesForPush2Pop2.insert(
Reg);
319 return CandidatesForPush2Pop2.size();
329 return SwiftAsyncContextFrameIdx;
334 auto Insert = PreallocatedIds.insert({CS, PreallocatedIds.size()});
336 PreallocatedStackSizes.push_back(0);
337 PreallocatedArgOffsets.emplace_back();
339 return Insert.first->second;
343 PreallocatedStackSizes[Id] = StackSize;
347 assert(PreallocatedStackSizes[Id] != 0 &&
"stack size not set");
348 return PreallocatedStackSizes[Id];
352 PreallocatedArgOffsets[Id].assign(AO.
begin(), AO.
end());
356 assert(!PreallocatedArgOffsets[Id].empty() &&
"arg offsets not set");
357 return PreallocatedArgOffsets[Id];
assert(UImm &&(UImm !=~static_cast< T >(0)) &&"Invalid immediate!")
static GCRegistry::Add< ShadowStackGC > C("shadow-stack", "Very portable GC for uncooperative code generators")
This file defines the SmallVector class.
Represent a constant reference to an array (0 or more elements consecutively in memory),...
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...
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)
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
bool getBPClobberedByInvoke() 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)
void setACEProgModel(const MachineFunction *MF, ACEProgModelEnum Model)
Record the ACE programming model of MF, reporting an error if it already uses the other one.
int getRestoreBasePointerOffset() const
ACEProgModelEnum getACEProgModel() 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 setBPClobberedByInvoke(bool C)
void setUsesRedZone(bool V)
bool hasPreallocatedCall() const
void setFPClobberedByInvoke(bool C)
bool hasSwiftAsyncContext() const
void setHasSEHFramePtrSave(bool V)
bool getRestoreBasePointer() const
MachineInstr * getStackPtrSaveMI() const
size_t getNumCandidatesForPush2Pop2() const
bool getHasVAStartSaveXMMRegs() const
MachineFunctionInfo * clone(BumpPtrAllocator &Allocator, MachineFunction &DestMF, const DenseMap< MachineBasicBlock *, MachineBasicBlock * > &Src2DstMBB) const override
Make a functionally equivalent copy of this MachineFunctionInfo in MF.
bool getFPClobberedByInvoke() const
void initializeBaseYamlFields(const yaml::X86MachineFunctionInfo &YamlMFI)
unsigned getBytesToPopOnReturn() const
void setHasVAStartSaveXMMRegs(bool Has)
AMXProgModelEnum getAMXProgModel() const
void setVarArgsFPOffset(unsigned Offset)
void addCandidateForPush2Pop2(Register Reg)
unsigned getCalleeSavedFrameSize() const
bool getHasPushSequences() 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)
void enumCase(T &Val, StringRef Str, const T ConstVal)
void mapOptional(StringRef Key, T &Val)
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.
BumpPtrAllocatorImpl<> BumpPtrAllocator
The standard BumpPtrAllocator which just uses the default template parameters.
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)
This class should be specialized by any type that needs to be converted to/from a YAML mapping.
static void enumeration(IO &YamlIO, ACEProgModelEnum &Value)
static void enumeration(IO &YamlIO, AMXProgModelEnum &Value)
This class should be specialized by any integral type that converts to/from a YAML scalar where there...
~X86MachineFunctionInfo() override=default
AMXProgModelEnum AMXProgModel
ACEProgModelEnum ACEProgModel
void mappingImpl(yaml::IO &YamlIO) override
bool HasVAStartSaveXMMRegs
X86MachineFunctionInfo()=default