50 #define DEBUG_TYPE "pei"
72 unsigned MinCSFrameIndex, MaxCSFrameIndex;
81 bool FrameIndexVirtualScavenging;
105 cl::desc(
"Warn for stack size bigger than the given"
109 "Prologue/Epilogue Insertion",
false,
false)
118 STATISTIC(NumScavengedRegs, "Number of frame index regs scavenged");
123 AU.setPreservesCFG();
151 if (!RestoreBlock->succ_empty() || isReturnBlock(RestoreBlock))
157 SaveBlock = Fn.
begin();
160 if (isReturnBlock(MBB))
161 RestoreBlocks.push_back(MBB);
185 calculateCallsInformation(Fn);
192 assignCalleeSavedSpillSlots(Fn, SavedRegs);
200 insertCSRSpillsAndRestores(Fn);
207 calculateFrameObjectOffsets(Fn);
215 insertPrologEpilogCode(Fn);
220 replaceFrameIndices(Fn);
226 scavengeFrameVirtualRegs(Fn);
240 RestoreBlocks.clear();
252 unsigned MaxCallFrameSize = 0;
261 if (FrameSetupOpcode == ~0u && FrameDestroyOpcode == ~0u)
264 std::vector<MachineBasicBlock::iterator> FrameSDOps;
267 if (
I->getOpcode() == FrameSetupOpcode ||
268 I->getOpcode() == FrameDestroyOpcode) {
269 assert(
I->getNumOperands() >= 1 &&
"Call Frame Setup/Destroy Pseudo"
270 " instructions should have a single immediate argument!");
271 unsigned Size =
I->getOperand(0).getImm();
272 if (Size > MaxCallFrameSize) MaxCallFrameSize = Size;
274 FrameSDOps.push_back(
I);
275 }
else if (
I->isInlineAsm()) {
285 for (std::vector<MachineBasicBlock::iterator>::iterator
286 i = FrameSDOps.begin(), e = FrameSDOps.end(); i != e; ++i) {
301 MinCSFrameIndex = INT_MAX;
304 if (SavedRegs.
empty())
310 std::vector<CalleeSavedInfo> CSI;
311 for (
unsigned i = 0; CSRegs[i]; ++i) {
312 unsigned Reg = CSRegs[i];
313 if (SavedRegs.
test(Reg))
325 unsigned NumFixedSpillSlots;
331 for (std::vector<CalleeSavedInfo>::iterator
I = CSI.begin(), E = CSI.end();
333 unsigned Reg =
I->getReg();
338 I->setFrameIdx(FrameIdx);
345 while (FixedSlot != FixedSpillSlots + NumFixedSpillSlots &&
346 FixedSlot->
Reg != Reg)
349 if (FixedSlot == FixedSpillSlots + NumFixedSpillSlots) {
357 Align =
std::min(Align, StackAlign);
359 if ((
unsigned)FrameIdx < MinCSFrameIndex) MinCSFrameIndex = FrameIdx;
360 if ((
unsigned)FrameIdx > MaxCSFrameIndex) MaxCSFrameIndex = FrameIdx;
367 I->setFrameIdx(FrameIdx);
406 while (!WorkList.
empty()) {
415 if (Visited.
insert(SuccBB).second)
421 for (
unsigned i = 0, e = CSI.size(); i != e; ++i) {
449 I = SaveBlock->begin();
451 for (
unsigned i = 0, e = CSI.size(); i != e; ++i) {
453 unsigned Reg = CSI[i].getReg();
469 while (I2 != MBB->
begin() && (--I2)->isTerminator())
472 bool AtStart = I == MBB->
begin();
480 for (
unsigned i = 0, e = CSI.size(); i != e; ++i) {
481 unsigned Reg = CSI[i].getReg();
484 assert(I != MBB->
begin() &&
485 "loadRegFromStackSlot didn't insert any code!");
502 bool StackGrowsDown, int64_t &Offset,
503 unsigned &MaxAlign) {
512 MaxAlign = std::max(MaxAlign, Align);
515 Offset = (Offset + Align - 1) / Align * Align;
517 if (StackGrowsDown) {
518 DEBUG(
dbgs() <<
"alloc FI(" << FrameIdx <<
") at SP[" << -Offset <<
"]\n");
521 DEBUG(
dbgs() <<
"alloc FI(" << FrameIdx <<
") at SP[" << Offset <<
"]\n");
533 int64_t &Offset,
unsigned &MaxAlign) {
536 E = UnassignedObjs.
end(); I != E; ++
I) {
550 bool StackGrowsDown =
561 LocalAreaOffset = -LocalAreaOffset;
562 assert(LocalAreaOffset >= 0
563 &&
"Local area offset should be in direction of stack growth");
564 int64_t Offset = LocalAreaOffset;
573 if (StackGrowsDown) {
583 if (FixedOff > Offset) Offset = FixedOff;
588 if (StackGrowsDown) {
589 for (
unsigned i = MinCSFrameIndex; i <= MaxCSFrameIndex; ++i) {
601 int MaxCSFI = MaxCSFrameIndex, MinCSFI = MinCSFrameIndex;
602 for (
int i = MaxCSFI; i >= MinCSFI ; --i) {
618 bool EarlyScavengingSlots = (TFI.
hasFP(Fn) &&
622 if (RS && EarlyScavengingSlots) {
624 RS->getScavengingFrameIndices(SFIs);
640 DEBUG(
dbgs() <<
"Local frame base offset: " << Offset <<
"\n");
645 int64_t FIOffset = (StackGrowsDown ? -Offset : Offset) + Entry.second;
646 DEBUG(
dbgs() <<
"alloc FI(" << Entry.first <<
") at SP[" <<
653 MaxAlign = std::max(Align, MaxAlign);
672 if (i >= MinCSFrameIndex && i <= MaxCSFrameIndex)
674 if (RS && RS->isScavengingFrameIndex((
int)i))
711 if (i >= MinCSFrameIndex && i <= MaxCSFrameIndex)
713 if (RS && RS->isScavengingFrameIndex((
int)i))
719 if (ProtectedObjs.
count(i))
727 if (RS && !EarlyScavengingSlots) {
729 RS->getScavengingFrameIndices(SFIs);
756 StackAlign = std::max(StackAlign, MaxAlign);
761 int64_t StackSize = Offset - LocalAreaOffset;
763 NumBytesStackSpace += StackSize;
832 if (DFI.getPathLength() >= 2) {
834 assert(Reachable.
count(StackPred) &&
835 "DFS stack predecessor is already visited.\n");
839 replaceFrameIndices(BB, Fn, SPAdj);
845 if (Reachable.
count(BB))
849 replaceFrameIndices(BB, Fn, SPAdj);
856 "getRegisterInfo() must be implemented!");
860 unsigned FrameSetupOpcode = TII.getCallFrameSetupOpcode();
861 unsigned FrameDestroyOpcode = TII.getCallFrameDestroyOpcode();
863 if (RS && !FrameIndexVirtualScavenging) RS->enterBasicBlock(BB);
865 bool InsideCallSequence =
false;
869 if (I->getOpcode() == FrameSetupOpcode ||
870 I->getOpcode() == FrameDestroyOpcode) {
871 InsideCallSequence = (I->getOpcode() == FrameSetupOpcode);
872 SPAdj += TII.getSPAdjust(I);
875 if (I != BB->
begin()) PrevI = std::prev(I);
879 if (PrevI == BB->
end())
882 I = std::next(PrevI);
896 assert(i == 0 &&
"Frame indicies can only appear as the first "
897 "operand of a DBG_VALUE machine instruction");
914 "Frame indicies can only appear as the first operand of a "
915 "DBG_VALUE machine instruction");
918 const unsigned refOffset =
934 bool AtBeginning = (I == BB->
begin());
935 if (!AtBeginning) --
I;
941 FrameIndexVirtualScavenging ?
nullptr : RS);
960 if (MI && InsideCallSequence)
961 SPAdj += TII.getSPAdjust(MI);
963 if (DoIncr && I != BB->
end()) ++I;
966 if (RS && !FrameIndexVirtualScavenging && MI) RS->forward(MI);
981 E = Fn.
end(); BB != E; ++BB) {
982 RS->enterBasicBlock(BB);
1010 unsigned Reg = MO.
getReg();
1019 "frame index virtual missing def!");
1022 unsigned ScratchReg = RS->scavengeRegister(RC, J, SPAdj);
1028 assert (ScratchReg &&
"Missing scratch register!");
1038 RS->setRegUsed(ScratchReg);
1046 if (I != std::prev(J)) {
1055 assert(RS->getCurrentPosition() == I &&
1056 "The register scavenger has an unexpected position");
unsigned getStackAlignment() const
getStackAlignment - This method returns the number of bytes to which the stack pointer must be aligne...
void push_back(const T &Elt)
void setPhysRegUsed(unsigned Reg)
setPhysRegUsed - Mark the specified register used in this function.
virtual bool hasReservedSpillSlot(const MachineFunction &MF, unsigned Reg, int &FrameIdx) const
hasReservedSpillSlot - Return true if target has reserved a spill slot in the stack frame of the give...
static PassRegistry * getPassRegistry()
getPassRegistry - Access the global registry object, which is automatically initialized at applicatio...
LLVMContext & getContext() const
getContext - Return a reference to the LLVMContext associated with this function. ...
void setCalleeSavedInfoValid(bool v)
STATISTIC(NumFunctions,"Total number of functions")
void ChangeToRegister(unsigned Reg, bool isDef, bool isImp=false, bool isKill=false, bool isDead=false, bool isUndef=false, bool isDebug=false)
ChangeToRegister - Replace this operand with a new register operand of the specified value...
int getNumber() const
getNumber - MachineBasicBlocks are uniquely numbered at the function level, unless they're not in a M...
WinEHFuncInfo & getWinEHFuncInfo(const Function *F)
static void updateLiveness(MachineFunction &MF)
Helper function to update the liveness information for the callee-saved registers.
MachineBasicBlock * getRestorePoint() const
static bool isVirtualRegister(unsigned Reg)
isVirtualRegister - Return true if the specified register number is in the virtual register namespace...
size_type count(PtrType Ptr) const
count - Return 1 if the specified pointer is in the set, 0 otherwise.
virtual void adjustForHiPEPrologue(MachineFunction &MF, MachineBasicBlock &PrologueMBB) const
Adjust the prologue to add Erlang Run-Time System (ERTS) specific code in the assembly prologue to ex...
bool adjustsStack() const
Return true if this function adjusts the stack – e.g., when calling another function.
void addLiveIn(unsigned Reg)
Adds the specified register as a live in.
uint16_t MCPhysReg
An unsigned integer type large enough to represent all physical registers, but not necessarily virtua...
const Function * getFunction() const
getFunction - Return the LLVM function that this machine code represents
virtual bool requiresFrameIndexScavenging(const MachineFunction &MF) const
requiresFrameIndexScavenging - returns true if the target requires post PEI scavenging of registers f...
virtual const SpillSlot * getCalleeSavedSpillSlots(unsigned &NumEntries) const
getCalleeSavedSpillSlots - This method returns a pointer to an array of pairs, that contains an entry...
vector_type::const_iterator const_iterator
bool hasWinEHFuncInfo(const Function *F) const
Diagnostic information for stack size reporting.
iterator end()
Get an iterator to the end of the SetVector.
bool isObjectPreAllocated(int ObjectIdx) const
Return true if the object was pre-allocated into the local block.
void clearVirtRegs()
clearVirtRegs - Remove all virtual registers (after physreg assignment).
CallingConv::ID getCallingConv() const
getCallingConv()/setCallingConv(CC) - These method get and set the calling convention of this functio...
iterator_range< succ_iterator > successors()
unsigned getMaxAlignment() const
Return the alignment in bytes that this function must be aligned to, which is greater than the defaul...
Prologue Epilogue Insertion &Frame false
const std::vector< CalleeSavedInfo > & getCalleeSavedInfo() const
Returns a reference to call saved info vector for the current function.
uint64_t getStackSize() const
Return the number of bytes that must be allocated to hold all of the fixed size frame objects...
virtual bool targetHandlesStackFrameRounding() const
targetHandlesStackFrameRounding - Returns true if the target is responsible for rounding up the stack...
int64_t getLocalFrameSize() const
Get the size of the local object blob.
unsigned getSize() const
getSize - Return the size of the register in bytes, which is also the size of a stack slot allocated ...
unsigned getNumVirtRegs() const
getNumVirtRegs - Return the number of virtual registers created.
#define INITIALIZE_PASS_DEPENDENCY(depName)
unsigned getCallFrameDestroyOpcode() const
Did not trigger a stack protector.
unsigned getNumBlockIDs() const
getNumBlockIDs - Return the number of MBB ID's allocated.
const TargetSubtargetInfo & getSubtarget() const
getSubtarget - Return the subtarget for which this machine code is being compiled.
virtual void processFunctionBeforeFrameFinalized(MachineFunction &MF, RegScavenger *RS=nullptr) const
processFunctionBeforeFrameFinalized - This method is called immediately before the specified function...
MachineFunctionPass - This class adapts the FunctionPass interface to allow convenient creation of pa...
const HexagonInstrInfo * TII
T LLVM_ATTRIBUTE_UNUSED_RESULT pop_back_val()
virtual bool hasFP(const MachineFunction &MF) const =0
hasFP - Return true if the specified function should have a dedicated frame pointer register...
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
This class consists of common code factored out of the SmallVector class to reduce code duplication b...
#define INITIALIZE_PASS_END(passName, arg, name, cfg, analysis)
bool isReg() const
isReg - Tests if this is a MO_Register operand.
const TargetRegisterClass * getRegClass(unsigned Reg) const
getRegClass - Return the register class of the specified virtual register.
Reg
All possible values of the reg field in the ModR/M byte.
The MachineFrameInfo class represents an abstract stack frame until prolog/epilog code is inserted...
Number of individual test Apply this number of consecutive mutations to each input exit after the first new interesting input is found the minimized corpus is saved into the first input directory Number of jobs to run If min(jobs, NumberOfCpuCores()/2)\" is used.") FUZZER_FLAG_INT(reload
The address of this allocation is exposed and triggered protection.
Target-Independent Code Generator Pass Configuration Options.
virtual bool restoreCalleeSavedRegisters(MachineBasicBlock &MBB, MachineBasicBlock::iterator MI, const std::vector< CalleeSavedInfo > &CSI, const TargetRegisterInfo *TRI) const
restoreCalleeSavedRegisters - Issues instruction(s) to restore all callee saved registers and returns...
unsigned getNumOperands() const
Access to explicit operands of the instruction.
const MachineBasicBlock & front() const
int getObjectIndexBegin() const
Return the minimum frame object index.
bool insert(const value_type &X)
Insert a new element into the SetVector.
bool isFI() const
isFI - Tests if this is a MO_FrameIndex operand.
bool LLVM_ATTRIBUTE_UNUSED_RESULT empty() const
unsigned getCallFrameSetupOpcode() const
These methods return the opcode of the frame setup/destroy instructions if they exist (-1 otherwise)...
virtual bool needsFrameIndexResolution(const MachineFunction &MF) const
unsigned getLocalFrameMaxAlign() const
Return the required alignment of the local object blob.
iterator begin()
Get an iterator to the beginning of the SetVector.
virtual void eliminateFrameIndex(MachineBasicBlock::iterator MI, int SPAdj, unsigned FIOperandNum, RegScavenger *RS=nullptr) const =0
eliminateFrameIndex - This method must be overriden to eliminate abstract frame indices from instruct...
virtual bool useFPForScavengingIndex(const MachineFunction &MF) const
useFPForScavengingIndex - returns true if the target wants to use frame pointer based accesses to spi...
static cl::opt< unsigned > WarnStackSize("warn-stack-size", cl::Hidden, cl::init((unsigned)-1), cl::desc("Warn for stack size bigger than the given"" number"))
virtual const MCPhysReg * getCalleeSavedRegs(const MachineFunction *MF) const =0
getCalleeSavedRegs - Return a null-terminated list of all of the callee saved registers on this targe...
virtual int getFrameIndexReference(const MachineFunction &MF, int FI, unsigned &FrameReg) const
getFrameIndexReference - This method should return the base register and offset used to reference a f...
unsigned getTransientStackAlignment() const
getTransientStackAlignment - This method returns the number of bytes to which the stack pointer must ...
unsigned getOpcode() const
Returns the opcode of this MachineInstr.
virtual bool requiresRegisterScavenging(const MachineFunction &MF) const
requiresRegisterScavenging - returns true if the target requires (and can make use of) the register s...
TargetInstrInfo - Interface to description of machine instruction set.
bool isDebugValue() const
virtual void emitPrologue(MachineFunction &MF, MachineBasicBlock &MBB) const =0
emitProlog/emitEpilog - These methods insert prolog and epilog code into the function.
bundle_iterator< MachineInstr, instr_iterator > iterator
DenseMap< const Function *, int > CatchHandlerParentFrameObjIdx
int UnwindHelpFrameOffset
initializer< Ty > init(const Ty &Val)
bool isReturn(QueryType Type=AnyInBundle) const
void initializePEIPass(PassRegistry &)
virtual bool spillCalleeSavedRegisters(MachineBasicBlock &MBB, MachineBasicBlock::iterator MI, const std::vector< CalleeSavedInfo > &CSI, const TargetRegisterInfo *TRI) const
spillCalleeSavedRegisters - Issues instruction(s) to spill all callee saved registers and returns tru...
virtual bool needsStackRealignment(const MachineFunction &MF) const
needsStackRealignment - true if storage within the function requires the stack pointer to be aligned ...
void getAnalysisUsage(AnalysisUsage &AU) const override
getAnalysisUsage - Subclasses that override getAnalysisUsage must call this.
unsigned getAlignment() const
getAlignment - Return the minimum required alignment for a register of this class.
bool getUseLocalStackAllocationBlock()
Get whether the local allocation blob should be allocated together or let PEI allocate the locals in ...
df_ext_iterator< T, SetTy > df_ext_end(const T &G, SetTy &S)
void setStackSize(uint64_t Size)
Set the size of the stack.
SmallSet - This maintains a set of unique values, optimizing for the case when the set is small (less...
const MachineOperand & getOperand(unsigned i) const
bool empty() const
empty - Tests whether there are no bits in this bitvector.
std::pair< iterator, bool > insert(PtrType Ptr)
Inserts Ptr if and only if there is no element in the container equal to Ptr.
bool shouldSplitStack()
Should we be emitting segmented stack stuff for the function.
virtual void loadRegFromStackSlot(MachineBasicBlock &MBB, MachineBasicBlock::iterator MI, unsigned DestReg, int FrameIndex, const TargetRegisterClass *RC, const TargetRegisterInfo *TRI) const
Load the specified register of the given register class from the specified stack frame index...
SmallSetVector< int, 8 > StackObjSet
StackObjSet - A set of stack object indexes.
Represent the analysis usage information of a pass.
df_ext_iterator< T, SetTy > df_ext_begin(const T &G, SetTy &S)
DenseMap< const Function *, int > CatchHandlerParentFrameObjOffset
void setImm(int64_t immVal)
for(unsigned i=0, e=MI->getNumOperands();i!=e;++i)
SSPLayoutKind getSSPLayout(const AllocaInst *AI) const
std::pair< NoneType, bool > insert(const T &V)
insert - Insert an element into the set if it isn't already there.
virtual void eliminateCallFramePseudoInstr(MachineFunction &MF, MachineBasicBlock &MBB, MachineBasicBlock::iterator MI) const
eliminateCallFramePseudoInstr - This method is called during prolog/epilog code insertion to eliminat...
INITIALIZE_PASS_BEGIN(PEI,"prologepilog","Prologue/Epilogue Insertion", false, false) INITIALIZE_PASS_END(PEI
virtual void storeRegToStackSlot(MachineBasicBlock &MBB, MachineBasicBlock::iterator MI, unsigned SrcReg, bool isKill, int FrameIndex, const TargetRegisterClass *RC, const TargetRegisterInfo *TRI) const
Store the specified register of the given register class to the specified stack frame index...
TargetRegisterInfo base class - We assume that the target defines a static array of TargetRegisterDes...
virtual bool hasReservedCallFrame(const MachineFunction &MF) const
hasReservedCallFrame - Under normal circumstances, when a frame pointer is not required, we reserve argument space for call sites in the function immediately on entry to the current function.
int64_t getObjectOffset(int ObjectIdx) const
Return the assigned stack offset of the specified object from the incoming stack pointer.
bool isDeadObjectIndex(int ObjectIdx) const
Returns true if the specified index corresponds to a dead object.
virtual void determineCalleeSaves(MachineFunction &MF, BitVector &SavedRegs, RegScavenger *RS=nullptr) const
This method determines which of the registers reported by TargetRegisterInfo::getCalleeSavedRegs() sh...
size_type count(const T &V) const
count - Return 1 if the element is in the set, 0 otherwise.
virtual const TargetFrameLowering * getFrameLowering() const
A SetVector that performs no allocations if smaller than a certain size.
int64_t getLocalFrameObjectCount()
Return the number of objects allocated into the local object block.
SmallPtrSet - This class implements a set which is optimized for holding SmallSize or less elements...
virtual void emitEpilogue(MachineFunction &MF, MachineBasicBlock &MBB) const =0
MachineOperand class - Representation of each machine instruction operand.
This is a 'vector' (really, a variable-sized array), optimized for the case when the array is small...
unsigned getObjectAlignment(int ObjectIdx) const
Return the alignment of the specified stack object.
bool test(unsigned Idx) const
int getOffsetOfLocalArea() const
getOffsetOfLocalArea - This method returns the offset of the local area from the stack pointer on ent...
Prologue Epilogue Insertion &Frame Finalization
unsigned getMaxCallFrameSize() const
Return the maximum size of a call frame that must be allocated for an outgoing function call...
Information about stack frame layout on the target.
virtual bool canSimplifyCallFramePseudos(const MachineFunction &MF) const
canSimplifyCallFramePseudos - When possible, it's best to simplify the call frame pseudo ops before d...
MachineFrameInfo * getFrameInfo()
getFrameInfo - Return the frame info object for the current function.
void setAdjustsStack(bool V)
static cl::opt< AlignMode > Align(cl::desc("Load/store alignment support"), cl::Hidden, cl::init(NoStrictAlign), cl::values(clEnumValN(StrictAlign,"aarch64-strict-align","Disallow all unaligned memory accesses"), clEnumValN(NoStrictAlign,"aarch64-no-strict-align","Allow unaligned memory accesses"), clEnumValEnd))
raw_ostream & dbgs()
dbgs() - This returns a reference to a raw_ostream for debugging messages.
The CalleeSavedInfo class tracks the information need to locate where a callee saved register is in t...
static void AdjustStackOffset(MachineFrameInfo *MFI, int FrameIdx, bool StackGrowsDown, int64_t &Offset, unsigned &MaxAlign)
AdjustStackOffset - Helper function used to adjust the stack frame offset.
static unsigned getReg(const void *D, unsigned RC, unsigned RegNo)
const TargetRegisterClass * getMinimalPhysRegClass(unsigned Reg, MVT VT=MVT::Other) const
getMinimalPhysRegClass - Returns the Register Class of a physical register of the given type...
void replaceRegWith(unsigned FromReg, unsigned ToReg)
replaceRegWith - Replace all instances of FromReg with ToReg in the machine function.
uint64_t RoundUpToAlignment(uint64_t Value, uint64_t Align)
Returns the next integer (mod 2**64) that is greater than or equal to Value and is a multiple of Alig...
int getStackProtectorIndex() const
Return the index for the stack protector object.
char & PrologEpilogCodeInserterID
PrologEpilogCodeInserter - This pass inserts prolog and epilog code, and eliminates abstract frame re...
MachineRegisterInfo - Keep track of information for virtual and physical registers, including vreg register classes, use/def chains for registers, etc.
MachineBasicBlock * getSavePoint() const
const Function * getWinEHParent(const Function *F) const
Representation of each machine instruction.
void setCalleeSavedInfo(const std::vector< CalleeSavedInfo > &CSI)
Used by prolog/epilog inserter to set the function's callee saved information.
StackDirection getStackGrowthDirection() const
getStackGrowthDirection - Return the direction the stack grows
bool hasFnAttribute(Attribute::AttrKind Kind) const
Return true if the function has the attribute.
void splice(iterator Where, MachineBasicBlock *Other, iterator From)
Take an instruction from MBB 'Other' at the position From, and insert it into this MBB right before '...
MachineRegisterInfo & getRegInfo()
getRegInfo - Return information about the registers currently in use.
Call instruction with associated vm state for deoptimization and list of live pointers for relocation...
void push_back(MachineInstr *MI)
virtual void adjustForSegmentedStacks(MachineFunction &MF, MachineBasicBlock &PrologueMBB) const
Adjust the prologue to have the function use segmented stacks.
void setMaxCallFrameSize(unsigned S)
virtual int getFrameIndexReferenceFromSP(const MachineFunction &MF, int FI, unsigned &FrameReg) const
Same as above, except that the 'base register' will always be RSP, not RBP on x86.
int CreateFixedSpillStackObject(uint64_t Size, int64_t SPOffset)
Create a spill slot at a fixed location on the stack.
void diagnose(const DiagnosticInfo &DI)
Report a message to the currently installed diagnostic handler.
bool hasVarSizedObjects() const
This method may be called any time after instruction selection is complete to determine if the stack ...
int CreateStackObject(uint64_t Size, unsigned Alignment, bool isSS, const AllocaInst *Alloca=nullptr)
Create a new statically sized stack object, returning a nonnegative identifier to represent it...
virtual bool assignCalleeSavedSpillSlots(MachineFunction &MF, const TargetRegisterInfo *TRI, std::vector< CalleeSavedInfo > &CSI) const
assignCalleeSavedSpillSlots - Allows target to override spill slot assignment logic.
unsigned getReg() const
getReg - Returns the register number.
virtual const TargetInstrInfo * getInstrInfo() const
BasicBlockListType::iterator iterator
void setObjectOffset(int ObjectIdx, int64_t SPOffset)
Set the stack frame offset of the specified object.
virtual const TargetRegisterInfo * getRegisterInfo() const
getRegisterInfo - If register information is available, return it.
MachineModuleInfo & getMMI() const
std::pair< int, int64_t > getLocalFrameObjectMap(int i)
Get the local offset mapping for a for an object.
int getObjectIndexEnd() const
Return one past the maximum frame object index.
always Inliner for always_inline functions
const AllocaInst * getObjectAllocation(int ObjectIdx) const
Return the underlying Alloca of the specified stack object if it exists.
static void AssignProtectedObjSet(const StackObjSet &UnassignedObjs, SmallSet< int, 16 > &ProtectedObjs, MachineFrameInfo *MFI, bool StackGrowsDown, int64_t &Offset, unsigned &MaxAlign)
AssignProtectedObjSet - Helper function to assign large stack objects (i.e., those required to be clo...
DominatorTree Class - Concrete subclass of DominatorTreeBase that is used to compute a normal dominat...
int64_t getObjectSize(int ObjectIdx) const
Return the size of the specified object.
Array or nested array >= SSP-buffer-size.
Array or nested array < SSP-buffer-size.
MachineModuleInfo - This class contains meta information specific to a module.
virtual bool isFPCloseToIncomingSP() const
isFPCloseToIncomingSP - Return true if the frame pointer is close to the incoming stack pointer...