LLVM
8.0.1
|
#include "Target/ARM/ARMFrameLowering.h"
Public Member Functions | |
ARMFrameLowering (const ARMSubtarget &sti) | |
void | emitPrologue (MachineFunction &MF, MachineBasicBlock &MBB) const override |
emitProlog/emitEpilog - These methods insert prolog and epilog code into the function. More... | |
void | emitEpilogue (MachineFunction &MF, MachineBasicBlock &MBB) const override |
bool | spillCalleeSavedRegisters (MachineBasicBlock &MBB, MachineBasicBlock::iterator MI, const std::vector< CalleeSavedInfo > &CSI, const TargetRegisterInfo *TRI) const override |
spillCalleeSavedRegisters - Issues instruction(s) to spill all callee saved registers and returns true if it isn't possible / profitable to do so by issuing a series of store instructions via storeRegToStackSlot(). More... | |
bool | restoreCalleeSavedRegisters (MachineBasicBlock &MBB, MachineBasicBlock::iterator MI, std::vector< CalleeSavedInfo > &CSI, const TargetRegisterInfo *TRI) const override |
restoreCalleeSavedRegisters - Issues instruction(s) to restore all callee saved registers and returns true if it isn't possible / profitable to do so by issuing a series of load instructions via loadRegToStackSlot(). More... | |
bool | keepFramePointer (const MachineFunction &MF) const override |
Return true if the target wants to keep the frame pointer regardless of the function attribute "frame-pointer". More... | |
bool | enableCalleeSaveSkip (const MachineFunction &MF) const override |
Returns true if the target can safely skip saving callee-saved registers for noreturn nounwind functions. More... | |
bool | hasFP (const MachineFunction &MF) const override |
hasFP - Return true if the specified function should have a dedicated frame pointer register. More... | |
bool | hasReservedCallFrame (const MachineFunction &MF) const override |
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. More... | |
bool | canSimplifyCallFramePseudos (const MachineFunction &MF) const override |
canSimplifyCallFramePseudos - If there is a reserved call frame, the call frame pseudos can be simplified. More... | |
int | getFrameIndexReference (const MachineFunction &MF, int FI, unsigned &FrameReg) const override |
getFrameIndexReference - Provide a base+offset reference to an FI slot for debug info. More... | |
int | ResolveFrameIndexReference (const MachineFunction &MF, int FI, unsigned &FrameReg, int SPAdj) const |
void | determineCalleeSaves (MachineFunction &MF, BitVector &SavedRegs, RegScavenger *RS) const override |
This method determines which of the registers reported by TargetRegisterInfo::getCalleeSavedRegs() should actually get saved. More... | |
void | adjustForSegmentedStacks (MachineFunction &MF, MachineBasicBlock &MBB) const override |
Adjust the prologue to have the function use segmented stacks. More... | |
bool | enableShrinkWrapping (const MachineFunction &MF) const override |
Returns true if the target will correctly handle shrink wrapping. More... | |
Public Member Functions inherited from llvm::TargetFrameLowering | |
TargetFrameLowering (StackDirection D, unsigned StackAl, int LAO, unsigned TransAl=1, bool StackReal=true) | |
virtual | ~TargetFrameLowering () |
StackDirection | getStackGrowthDirection () const |
getStackGrowthDirection - Return the direction the stack grows More... | |
unsigned | getStackAlignment () const |
getStackAlignment - This method returns the number of bytes to which the stack pointer must be aligned on entry to a function. More... | |
int | alignSPAdjust (int SPAdj) const |
alignSPAdjust - This method aligns the stack adjustment to the correct alignment. More... | |
unsigned | getTransientStackAlignment () const |
getTransientStackAlignment - This method returns the number of bytes to which the stack pointer must be aligned at all times, even between calls. More... | |
bool | isStackRealignable () const |
isStackRealignable - This method returns whether the stack can be realigned. More... | |
virtual unsigned | getStackAlignmentSkew (const MachineFunction &MF) const |
Return the skew that has to be applied to stack alignment under certain conditions (e.g. More... | |
int | getOffsetOfLocalArea () const |
getOffsetOfLocalArea - This method returns the offset of the local area from the stack pointer on entrance to a function. More... | |
virtual bool | isFPCloseToIncomingSP () const |
isFPCloseToIncomingSP - Return true if the frame pointer is close to the incoming stack pointer, false if it is close to the post-prologue stack pointer. More... | |
virtual bool | assignCalleeSavedSpillSlots (MachineFunction &MF, const TargetRegisterInfo *TRI, std::vector< CalleeSavedInfo > &CSI) const |
assignCalleeSavedSpillSlots - Allows target to override spill slot assignment logic. More... | |
virtual const SpillSlot * | getCalleeSavedSpillSlots (unsigned &NumEntries) const |
getCalleeSavedSpillSlots - This method returns a pointer to an array of pairs, that contains an entry for each callee saved register that must be spilled to a particular stack location if it is spilled. More... | |
virtual bool | targetHandlesStackFrameRounding () const |
targetHandlesStackFrameRounding - Returns true if the target is responsible for rounding up the stack frame (probably at emitPrologue time). More... | |
virtual bool | enableStackSlotScavenging (const MachineFunction &MF) const |
Returns true if the stack slot holes in the fixed and callee-save stack area should be used when allocating other stack locations to reduce stack size. More... | |
virtual void | inlineStackProbe (MachineFunction &MF, MachineBasicBlock &PrologueMBB) const |
Replace a StackProbe stub (if any) with the actual probe code inline. More... | |
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 explicitly handle the stack. More... | |
virtual bool | needsFrameIndexResolution (const MachineFunction &MF) const |
virtual int | getFrameIndexReferencePreferSP (const MachineFunction &MF, int FI, unsigned &FrameReg, bool IgnoreSPUpdates) const |
Same as getFrameIndexReference , except that the stack pointer (as opposed to the frame pointer) will be the preferred value for FrameReg . More... | |
virtual void | processFunctionBeforeFrameFinalized (MachineFunction &MF, RegScavenger *RS=nullptr) const |
processFunctionBeforeFrameFinalized - This method is called immediately before the specified function's frame layout (MF.getFrameInfo()) is finalized. More... | |
virtual unsigned | getWinEHParentFrameOffset (const MachineFunction &MF) const |
virtual void | orderFrameObjects (const MachineFunction &MF, SmallVectorImpl< int > &objectsToAllocate) const |
Order the symbols in the local stack frame. More... | |
virtual bool | canUseAsPrologue (const MachineBasicBlock &MBB) const |
Check whether or not the given MBB can be used as a prologue for the target. More... | |
virtual bool | canUseAsEpilogue (const MachineBasicBlock &MBB) const |
Check whether or not the given MBB can be used as a epilogue for the target. More... | |
virtual int | getInitialCFAOffset (const MachineFunction &MF) const |
Return initial CFA offset value i.e. More... | |
virtual unsigned | getInitialCFARegister (const MachineFunction &MF) const |
Return initial CFA register value i.e. More... | |
Protected Attributes | |
const ARMSubtarget & | STI |
Additional Inherited Members | |
Public Types inherited from llvm::TargetFrameLowering | |
enum | StackDirection { StackGrowsUp, StackGrowsDown } |
Static Public Member Functions inherited from llvm::TargetFrameLowering | |
static bool | isSafeForNoCSROpt (const Function &F) |
Check if given function is safe for not having callee saved registers. More... | |
Definition at line 23 of file ARMFrameLowering.h.
|
explicit |
Definition at line 78 of file ARMFrameLowering.cpp.
|
overridevirtual |
Adjust the prologue to have the function use segmented stacks.
This works by adding a check even before the "normal" function prologue.
Reimplemented from llvm::TargetFrameLowering.
Definition at line 2133 of file ARMFrameLowering.cpp.
References llvm::ARM_AM::add, llvm::MachineInstrBuilder::add(), llvm::MachineFunction::addFrameInst(), llvm::MachineInstrBuilder::addImm(), llvm::MachineInstrBuilder::addReg(), llvm::MachineBasicBlock::addSuccessor(), llvm::ARMCC::AL, alignToARMConstant(), assert(), B, llvm::ARCISD::BL, llvm::BuildMI(), llvm::condCodeOp(), Context, llvm::ARMConstantPoolSymbol::Create(), llvm::MCCFIInstruction::createDefCfaOffset(), llvm::MachineFunction::CreateMachineBasicBlock(), llvm::MCCFIInstruction::createOffset(), llvm::ARMFunctionInfo::createPICLabelUId(), llvm::MCCFIInstruction::createSameValue(), llvm::RegState::Define, llvm::SmallVectorBase::empty(), llvm::SmallPtrSetImpl< PtrType >::erase(), llvm::ARMFunctionInfo::getArgumentStackSize(), llvm::MachineFunction::getConstantPool(), llvm::MachineConstantPool::getConstantPoolIndex(), llvm::MachineModuleInfo::getContext(), llvm::Function::getContext(), llvm::MCRegisterInfo::getDwarfRegNum(), llvm::MachineFunction::getFrameInfo(), llvm::MachineFunction::getFunction(), llvm::MachineFunction::getInfo(), llvm::TargetSubtargetInfo::getInstrInfo(), llvm::ilist_node_impl< OptionsT >::getIterator(), llvm::MachineFunction::getMMI(), llvm::MCContext::getRegisterInfo(), llvm::ARMSubtarget::getReturnOpcode(), llvm::MachineFrameInfo::getStackSize(), llvm::MachineFunction::getSubtarget(), llvm::MachineFrameInfo::hasTailCall(), llvm::SmallPtrSetImpl< PtrType >::insert(), llvm::MachineFunction::insert(), llvm::ARMSubtarget::isTargetAndroid(), llvm::ARMSubtarget::isTargetLinux(), llvm::ARMSubtarget::isThumb(), llvm::ARMSubtarget::isThumb1Only(), llvm::Function::isVarArg(), kSplitStackAvailable, llvm::MachineBasicBlock::liveins(), llvm::ARMCC::LO, MRI, llvm::SmallVectorImpl< T >::pop_back_val(), llvm::MachineBasicBlock::predecessors(), llvm::predOps(), llvm::SmallVectorTemplateBase< T >::push_back(), R4, llvm::MachineBasicBlock::ReplaceUsesOfBlockWith(), llvm::report_fatal_error(), llvm::MachineModuleInfo::setHasNosplitStack(), llvm::MachineBasicBlock::sortUniqueLiveIns(), llvm::ARM_MB::ST, TII, and llvm::MachineFunction::verify().
|
overridevirtual |
canSimplifyCallFramePseudos - If there is a reserved call frame, the call frame pseudos can be simplified.
Unlike most targets, having a FP is not sufficient here since we still may reference some objects via SP even when FP is available in Thumb2 mode.
Reimplemented from llvm::TargetFrameLowering.
Definition at line 141 of file ARMFrameLowering.cpp.
References llvm::MachineFunction::getFrameInfo(), hasReservedCallFrame(), and llvm::MachineFrameInfo::hasVarSizedObjects().
Referenced by determineCalleeSaves().
|
overridevirtual |
This method determines which of the registers reported by TargetRegisterInfo::getCalleeSavedRegs() should actually get saved.
The default implementation checks populates the SavedRegs
bitset with all registers which are modified in the function, targets may override this function to save additional registers. This method also sets up the register scavenger ensuring there is a free register or a frameindex available.
Reimplemented from llvm::TargetFrameLowering.
Definition at line 1590 of file ARMFrameLowering.cpp.
References llvm::RegScavenger::addScavengingFrameIndex(), llvm::ARMCC::AL, llvm::AMDGPU::HSAMD::Kernel::Arg::Key::Align, llvm::TargetFrameLowering::alignSPAdjust(), assert(), llvm::SmallVectorTemplateCommon< T, typename >::back(), llvm::ARMBaseRegisterInfo::cannotEliminateFrame(), canSimplifyCallFramePseudos(), checkNumAlignedDPRCS2Regs(), contains(), llvm::dbgs(), llvm::TargetFrameLowering::determineCalleeSaves(), llvm::TargetOptions::DisableFramePointerElim(), emitSPUpdate(), llvm::SmallVectorBase::empty(), llvm::SmallVectorTemplateCommon< T, typename >::end(), llvm::SmallVectorImpl< T >::erase(), llvm::MachineBasicBlock::erase(), estimateRSStackSizeLimit(), llvm::find(), llvm::MachineInstr::findFirstPredOperandIdx(), llvm::HexagonII::FPPos, llvm::SmallVectorTemplateCommon< T, typename >::front(), llvm::ARMFunctionInfo::getArgRegsSaveSize(), llvm::ARMBaseRegisterInfo::getBaseRegister(), llvm::ARMBaseRegisterInfo::getCalleeSavedRegs(), llvm::MachineInstr::getDebugLoc(), llvm::MachineFunction::getFrameInfo(), llvm::ARMBaseInstrInfo::getFramePred(), llvm::ARMBaseRegisterInfo::getFrameRegister(), llvm::MachineFunction::getFunction(), GetFunctionSizeInBytes(), llvm::MachineOperand::getImm(), llvm::MachineFunction::getInfo(), llvm::TargetSubtargetInfo::getInstrInfo(), getMaxFPOffset(), llvm::MachineInstr::getOpcode(), llvm::MachineInstr::getOperand(), llvm::MachineFunction::getRegInfo(), llvm::TargetSubtargetInfo::getRegisterInfo(), llvm::ARMFunctionInfo::getReturnRegsCount(), llvm::TargetRegisterInfo::getSpillAlignment(), llvm::TargetRegisterInfo::getSpillSize(), llvm::TargetFrameLowering::getStackAlignment(), llvm::MachineFunction::getSubtarget(), llvm::MachineFunction::getTarget(), llvm::ARMBaseRegisterInfo::hasBasePointer(), hasFP(), hasReservedCallFrame(), llvm::ARMFunctionInfo::hasStackFrame(), I, llvm::isARMLowRegister(), llvm::MachineRegisterInfo::isLiveIn(), llvm::MachineRegisterInfo::isPhysRegUsed(), llvm::MachineRegisterInfo::isReserved(), llvm::MachineFrameInfo::isReturnAddressTaken(), llvm::ARMSubtarget::isTargetWindows(), llvm::ARMFunctionInfo::isThumb1OnlyFunction(), llvm::ARMFunctionInfo::isThumb2Function(), llvm::ARMFunctionInfo::isThumbFunction(), LLVM_DEBUG, LLVM_FALLTHROUGH, llvm::max(), MRI, llvm::MachineInstr::NoFlags, llvm::TargetMachine::Options, llvm::SmallVectorTemplateBase< T, bool >::pop_back(), llvm::SmallVectorImpl< T >::pop_back_val(), llvm::printReg(), llvm::SmallVectorTemplateBase< T, bool >::push_back(), R2, R4, R6, Reg, llvm::BitVector::set(), llvm::ARMFunctionInfo::setHasStackFrame(), llvm::ARMFunctionInfo::setLRIsSpilledForFarJump(), Size, llvm::SmallVectorBase::size(), llvm::ARMSubtarget::splitFramePushPop(), STI, llvm::BitVector::test(), TII, TRI, and WindowsRequiresStackProbe().
|
overridevirtual |
Implements llvm::TargetFrameLowering.
Reimplemented in llvm::Thumb1FrameLowering.
Definition at line 766 of file ARMFrameLowering.cpp.
References llvm::MachineInstrBuilder::add(), llvm::ARMCC::AL, assert(), llvm::MachineBasicBlock::begin(), llvm::BuildMI(), llvm::condCodeOp(), llvm::emitARMRegPlusImmediate(), emitSPUpdate(), llvm::emitT2RegPlusImmediate(), llvm::MachineBasicBlock::end(), llvm::ARMFunctionInfo::getArgRegsSaveSize(), llvm::Function::getCallingConv(), llvm::ARMFunctionInfo::getDPRCalleeSavedAreaSize(), llvm::ARMFunctionInfo::getDPRCalleeSavedGapSize(), llvm::MachineBasicBlock::getFirstTerminator(), llvm::MachineFunction::getFrameInfo(), llvm::ARMFunctionInfo::getFramePtrSpillOffset(), llvm::MachineFunction::getFunction(), llvm::ARMFunctionInfo::getGPRCalleeSavedArea1Size(), llvm::ARMFunctionInfo::getGPRCalleeSavedArea2Size(), llvm::MachineFunction::getInfo(), llvm::TargetSubtargetInfo::getInstrInfo(), llvm::MachineFrameInfo::getPristineRegs(), llvm::TargetSubtargetInfo::getRegisterInfo(), llvm::MachineFrameInfo::getStackSize(), llvm::MachineFunction::getSubtarget(), llvm::CallingConv::GHC, llvm::ARMFunctionInfo::hasStackFrame(), isCSRestore(), llvm::ARMFunctionInfo::isThumb1OnlyFunction(), llvm::ARMFunctionInfo::isThumbFunction(), llvm::predOps(), R4, llvm::ARMFunctionInfo::shouldRestoreSPFromFP(), STI, llvm::BitVector::test(), TII, and llvm::tryFoldSPUpdateIntoPushPop().
|
overridevirtual |
emitProlog/emitEpilog - These methods insert prolog and epilog code into the function.
Implements llvm::TargetFrameLowering.
Reimplemented in llvm::Thumb1FrameLowering.
Definition at line 352 of file ARMFrameLowering.cpp.
References llvm::ARM_AM::add, llvm::MachineInstrBuilder::add(), llvm::MachineFunction::addFrameInst(), llvm::MachineInstrBuilder::addReg(), llvm::ARMCC::AL, llvm::AMDGPU::HSAMD::Kernel::Arg::Key::Align, assert(), llvm::MachineBasicBlock::begin(), llvm::BuildMI(), llvm::condCodeOp(), Context, llvm::MCCFIInstruction::createDefCfa(), llvm::MCCFIInstruction::createDefCfaRegister(), llvm::MCCFIInstruction::createOffset(), emitAligningInstructions(), emitRegPlusImmediate(), emitSPUpdate(), llvm::MachineBasicBlock::end(), llvm::MachineInstr::FrameSetup, llvm::ARMFunctionInfo::getArgRegsSaveSize(), llvm::ARMBaseRegisterInfo::getBaseRegister(), llvm::MachineFrameInfo::getCalleeSavedInfo(), llvm::Function::getCallingConv(), llvm::TargetMachine::getCodeModel(), llvm::MCRegisterInfo::getDwarfRegNum(), llvm::MachineFunction::getFrameInfo(), llvm::ARMSubtarget::getFrameLowering(), llvm::ARMFunctionInfo::getFramePtrSpillOffset(), llvm::ARMBaseRegisterInfo::getFrameRegister(), llvm::MachineFunction::getFunction(), llvm::MachineFunction::getInfo(), llvm::ARMSubtarget::getInstrInfo(), llvm::MachineFrameInfo::getMaxAlignment(), getMaxFPOffset(), llvm::MachineFunction::getMMI(), llvm::ARMFunctionInfo::getNumAlignedDPRCS2Regs(), llvm::MachineFrameInfo::getObjectOffset(), llvm::MachineFrameInfo::getOffsetAdjustment(), llvm::MCContext::getRegisterInfo(), llvm::ARMSubtarget::getRegisterInfo(), llvm::TargetFrameLowering::getStackAlignment(), llvm::MachineFrameInfo::getStackSize(), llvm::MachineFunction::getTarget(), llvm::CallingConv::GHC, llvm::ARMBaseRegisterInfo::hasBasePointer(), hasFP(), llvm::ARMFunctionInfo::hasStackFrame(), llvm::MachineFrameInfo::hasVarSizedObjects(), llvm::RegState::Implicit, llvm::ARMSubtarget::isTargetELF(), llvm::ARMSubtarget::isTargetWindows(), llvm::ARMFunctionInfo::isThumb1OnlyFunction(), llvm::ARMFunctionInfo::isThumbFunction(), llvm::CodeModel::Kernel, llvm::RegState::Kill, llvm::CodeModel::Large, LLVM_FALLTHROUGH, llvm_unreachable, llvm::CodeModel::Medium, MRI, llvm::predOps(), R2, R4, R6, Reg, llvm::ARMFunctionInfo::setDPRCalleeSavedAreaOffset(), llvm::ARMFunctionInfo::setDPRCalleeSavedAreaSize(), llvm::ARMFunctionInfo::setDPRCalleeSavedGapSize(), llvm::ARMFunctionInfo::setFramePtrSpillOffset(), llvm::ARMFunctionInfo::setGPRCalleeSavedArea1Offset(), llvm::ARMFunctionInfo::setGPRCalleeSavedArea1Size(), llvm::ARMFunctionInfo::setGPRCalleeSavedArea2Offset(), llvm::ARMFunctionInfo::setGPRCalleeSavedArea2Size(), llvm::MachineInstrBuilder::setMIFlags(), llvm::MachineFrameInfo::setOffsetAdjustment(), llvm::ARMFunctionInfo::setShouldRestoreSPFromFP(), sizeOfSPAdjustment(), skipAlignedDPRCS2Spills(), llvm::CodeModel::Small, llvm::ARMSubtarget::splitFramePushPop(), STI, TII, llvm::CodeModel::Tiny, llvm::SystemZISD::TM, llvm::tryFoldSPUpdateIntoPushPop(), and WindowsRequiresStackProbe().
|
overridevirtual |
Returns true if the target can safely skip saving callee-saved registers for noreturn nounwind functions.
Reimplemented from llvm::TargetFrameLowering.
Definition at line 91 of file ARMFrameLowering.cpp.
References assert(), llvm::MachineFunction::getFunction(), llvm::Function::hasFnAttribute(), llvm::Attribute::NoReturn, llvm::Attribute::NoUnwind, and llvm::Attribute::UWTable.
|
inlineoverridevirtual |
Returns true if the target will correctly handle shrink wrapping.
Reimplemented from llvm::TargetFrameLowering.
Reimplemented in llvm::Thumb1FrameLowering.
Definition at line 64 of file ARMFrameLowering.h.
References MI.
|
overridevirtual |
getFrameIndexReference - Provide a base+offset reference to an FI slot for debug info.
It's the same as what we use for resolving the code-gen references for now. FIXME: This can go wrong when references are SP-relative and simple call frames aren't used.
Reimplemented from llvm::TargetFrameLowering.
Definition at line 878 of file ARMFrameLowering.cpp.
References ResolveFrameIndexReference().
|
overridevirtual |
hasFP - Return true if the specified function should have a dedicated frame pointer register.
This is true if the function has variable sized allocas or if frame pointer elimination is disabled.
Implements llvm::TargetFrameLowering.
Definition at line 104 of file ARMFrameLowering.cpp.
References llvm::TargetOptions::DisableFramePointerElim(), llvm::MachineFunction::getFrameInfo(), llvm::TargetSubtargetInfo::getRegisterInfo(), llvm::MachineFunction::getSubtarget(), llvm::MachineFunction::getTarget(), llvm::MachineFrameInfo::hasVarSizedObjects(), llvm::MachineFrameInfo::isFrameAddressTaken(), llvm::TargetRegisterInfo::needsStackRealignment(), and llvm::TargetMachine::Options.
Referenced by determineCalleeSaves(), llvm::Thumb1FrameLowering::emitPrologue(), emitPrologue(), llvm::ARMBaseRegisterInfo::needsFrameBaseReg(), ResolveFrameIndexReference(), llvm::Thumb1FrameLowering::restoreCalleeSavedRegisters(), and llvm::Thumb1FrameLowering::spillCalleeSavedRegisters().
|
overridevirtual |
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.
This eliminates the need for add/sub sp brackets around call sites. Returns true if the call frame is included as part of the stack frame.
Reimplemented from llvm::TargetFrameLowering.
Reimplemented in llvm::Thumb1FrameLowering.
Definition at line 123 of file ARMFrameLowering.cpp.
References llvm::MachineFunction::getFrameInfo(), llvm::MachineFrameInfo::getMaxCallFrameSize(), and llvm::MachineFrameInfo::hasVarSizedObjects().
Referenced by llvm::ARMBaseRegisterInfo::canRealignStack(), canSimplifyCallFramePseudos(), determineCalleeSaves(), llvm::ThumbRegisterInfo::eliminateFrameIndex(), llvm::ARMBaseRegisterInfo::eliminateFrameIndex(), and ResolveFrameIndexReference().
|
overridevirtual |
Return true if the target wants to keep the frame pointer regardless of the function attribute "frame-pointer".
Reimplemented from llvm::TargetFrameLowering.
Definition at line 82 of file ARMFrameLowering.cpp.
References llvm::MachineFunction::getSubtarget().
int ARMFrameLowering::ResolveFrameIndexReference | ( | const MachineFunction & | MF, |
int | FI, | ||
unsigned & | FrameReg, | ||
int | SPAdj | ||
) | const |
Definition at line 884 of file ARMFrameLowering.cpp.
References llvm::ARM_AM::add, llvm::MachineInstrBuilder::add(), llvm::MachineInstrBuilder::addImm(), llvm::MachineBasicBlock::addLiveIn(), llvm::MachineInstrBuilder::addReg(), llvm::ARMCC::AL, assert(), llvm::MachineBasicBlock::begin(), llvm::BuildMI(), llvm::SmallVectorImpl< T >::clear(), llvm::MachineInstrBuilder::copyImplicitOps(), llvm::RegState::Define, llvm::SmallVectorBase::empty(), llvm::MachineBasicBlock::end(), first, llvm::MCInstrInfo::get(), llvm::ARM_AM::getAM2Opc(), llvm::ARMBaseRegisterInfo::getBaseRegister(), llvm::getDefRegState(), llvm::MCRegisterInfo::getEncodingValue(), llvm::MachineFunction::getFrameInfo(), llvm::ARMFunctionInfo::getFramePtrSpillOffset(), llvm::ARMBaseRegisterInfo::getFrameRegister(), llvm::MachineFunction::getInfo(), llvm::TargetSubtargetInfo::getInstrInfo(), llvm::getKillRegState(), llvm::MachineFrameInfo::getObjectOffset(), llvm::MachineBasicBlock::getParent(), llvm::CalleeSavedInfo::getReg(), llvm::MachineFunction::getRegInfo(), llvm::TargetSubtargetInfo::getRegisterInfo(), llvm::ARMSubtarget::getRegisterInfo(), llvm::MachineFrameInfo::getStackSize(), llvm::MachineFunction::getSubtarget(), llvm::ARMBaseRegisterInfo::hasBasePointer(), hasFP(), hasReservedCallFrame(), llvm::ARMFunctionInfo::hasStackFrame(), llvm::ARMSubtarget::hasV5TOps(), Info, llvm::MachineFrameInfo::isFixedObjectIndex(), llvm::MachineRegisterInfo::isLiveIn(), llvm::MachineRegisterInfo::isReserved(), llvm::ARMFunctionInfo::isThumb2Function(), llvm::ARMFunctionInfo::isThumbFunction(), MI, MRI, llvm::ARM_AM::no_shift, llvm::predOps(), llvm::SmallVectorTemplateBase< T >::push_back(), llvm::SmallVectorTemplateBase< T, bool >::push_back(), Reg, second, llvm::MachineInstrBuilder::setMIFlags(), llvm::CalleeSavedInfo::setRestored(), llvm::SmallVectorBase::size(), llvm::sort(), llvm::ARMSubtarget::splitFramePushPop(), STI, llvm::MachineBasicBlock::succ_empty(), TII, llvm::ISD::TRAP, and TRI.
Referenced by llvm::ThumbRegisterInfo::eliminateFrameIndex(), llvm::ARMBaseRegisterInfo::eliminateFrameIndex(), and getFrameIndexReference().
|
overridevirtual |
restoreCalleeSavedRegisters - Issues instruction(s) to restore all callee saved registers and returns true if it isn't possible / profitable to do so by issuing a series of load instructions via loadRegToStackSlot().
If it returns true, and any of the registers in CSI is not restored, it sets the corresponding Restored flag in CSI to false. Returns false otherwise.
Reimplemented from llvm::TargetFrameLowering.
Reimplemented in llvm::Thumb1FrameLowering.
Definition at line 1448 of file ARMFrameLowering.cpp.
References emitAlignedDPRCS2Restores(), llvm::ARMFunctionInfo::getArgRegsSaveSize(), llvm::MachineFunction::getInfo(), llvm::ARMFunctionInfo::getNumAlignedDPRCS2Regs(), llvm::MachineBasicBlock::getParent(), llvm::isARMArea1Register(), llvm::isARMArea2Register(), llvm::isARMArea3Register(), and llvm::ARMFunctionInfo::isThumbFunction().
|
overridevirtual |
spillCalleeSavedRegisters - Issues instruction(s) to spill all callee saved registers and returns true if it isn't possible / profitable to do so by issuing a series of store instructions via storeRegToStackSlot().
Returns false otherwise.
Reimplemented from llvm::TargetFrameLowering.
Reimplemented in llvm::Thumb1FrameLowering.
Definition at line 1417 of file ARMFrameLowering.cpp.
References emitAlignedDPRCS2Spills(), llvm::MachineInstr::FrameSetup, llvm::MachineFunction::getInfo(), llvm::ARMFunctionInfo::getNumAlignedDPRCS2Regs(), llvm::MachineBasicBlock::getParent(), llvm::isARMArea1Register(), llvm::isARMArea2Register(), llvm::isARMArea3Register(), and llvm::ARMFunctionInfo::isThumbFunction().
|
protected |
Definition at line 25 of file ARMFrameLowering.h.
Referenced by determineCalleeSaves(), llvm::Thumb1FrameLowering::eliminateCallFramePseudoInstr(), llvm::Thumb1FrameLowering::emitEpilogue(), emitEpilogue(), llvm::Thumb1FrameLowering::emitPrologue(), emitPrologue(), findTemporariesForLR(), ResolveFrameIndexReference(), llvm::Thumb1FrameLowering::restoreCalleeSavedRegisters(), and llvm::Thumb1FrameLowering::spillCalleeSavedRegisters().