LLVM API Documentation
#include <AArch64FrameLowering.h>
Definition at line 21 of file AArch64FrameLowering.h.
llvm::AArch64FrameLowering::AArch64FrameLowering | ( | ) | [inline, explicit] |
Definition at line 23 of file AArch64FrameLowering.h.
bool AArch64FrameLowering::canUseRedZone | ( | const MachineFunction & | MF | ) | const |
Can this function use the red zone for local allocations.
Definition at line 62 of file AArch64FrameLowering.cpp.
References EnableRedZone, llvm::AttributeSet::FunctionIndex, llvm::Function::getAttributes(), llvm::MachineFunction::getFrameInfo(), llvm::MachineFunction::getFunction(), llvm::MachineFunction::getInfo(), llvm::AArch64FunctionInfo::getLocalStackSize(), llvm::AttributeSet::hasAttribute(), llvm::MachineFrameInfo::hasCalls(), hasFP(), and llvm::Attribute::NoRedZone.
Referenced by emitEpilogue(), emitPrologue(), and resolveFrameIndexReference().
void AArch64FrameLowering::eliminateCallFramePseudoInstr | ( | MachineFunction & | MF, |
MachineBasicBlock & | MBB, | ||
MachineBasicBlock::iterator | MI | ||
) | const [override, virtual] |
eliminateCallFramePseudoInstr - This method is called during prolog/epilog code insertion to eliminate call frame setup and destroy pseudo instructions (but only if the Target is using them). It is responsible for eliminating these instructions, replacing them with concrete instructions. This method need only be implemented if using call frame setup/destroy pseudo instructions.
Reimplemented from llvm::TargetFrameLowering.
Definition at line 108 of file AArch64FrameLowering.cpp.
References Align(), llvm::emitFrameOffset(), llvm::MachineBasicBlock::erase(), llvm::TargetSubtargetInfo::getFrameLowering(), llvm::TargetSubtargetInfo::getInstrInfo(), llvm::TargetFrameLowering::getStackAlignment(), llvm::MachineFunction::getSubtarget(), llvm::TargetFrameLowering::hasReservedCallFrame(), llvm::RoundUpToAlignment(), and TII.
void AArch64FrameLowering::emitCalleeSavedFrameMoves | ( | MachineBasicBlock & | MBB, |
MachineBasicBlock::iterator | MBBI, | ||
unsigned | FramePtr | ||
) | const |
Definition at line 154 of file AArch64FrameLowering.cpp.
References llvm::MachineModuleInfo::addFrameInst(), llvm::BuildMI(), llvm::TargetOpcode::CFI_INSTRUCTION, llvm::MCCFIInstruction::createOffset(), llvm::MachineBasicBlock::findDebugLoc(), llvm::MCInstrInfo::get(), llvm::MachineFrameInfo::getCalleeSavedInfo(), llvm::MachineModuleInfo::getContext(), llvm::TargetSubtargetInfo::getDataLayout(), llvm::MCRegisterInfo::getDwarfRegNum(), llvm::MachineFunction::getFrameInfo(), llvm::TargetSubtargetInfo::getInstrInfo(), llvm::MachineFunction::getMMI(), llvm::MachineFrameInfo::getObjectOffset(), llvm::TargetFrameLowering::getOffsetOfLocalArea(), llvm::MachineBasicBlock::getParent(), llvm::DataLayout::getPointerSize(), llvm::MCContext::getRegisterInfo(), llvm::MachineFunction::getSubtarget(), hasFP(), and TII.
Referenced by emitPrologue().
void AArch64FrameLowering::emitEpilogue | ( | MachineFunction & | MF, |
MachineBasicBlock & | MBB | ||
) | const [override, virtual] |
Implements llvm::TargetFrameLowering.
Definition at line 432 of file AArch64FrameLowering.cpp.
References llvm::MachineBasicBlock::begin(), canUseRedZone(), llvm::emitFrameOffset(), llvm::AArch64FunctionInfo::getArgumentStackToRestore(), llvm::AArch64RegisterInfo::getCalleeSavedRegs(), llvm::MachineFunction::getFrameInfo(), llvm::MachineOperand::getImm(), llvm::MachineFunction::getInfo(), llvm::TargetSubtargetInfo::getInstrInfo(), llvm::MachineBasicBlock::getLastNonDebugInstr(), llvm::TargetSubtargetInfo::getRegisterInfo(), llvm::MachineFunction::getSubtarget(), hasFP(), isCSRestore(), llvm::MachineInstr::NoFlags, and TII.
void AArch64FrameLowering::emitPrologue | ( | MachineFunction & | MF | ) | const [override, virtual] |
emitProlog/emitEpilog - These methods insert prolog and epilog code into the function.
Implements llvm::TargetFrameLowering.
Definition at line 202 of file AArch64FrameLowering.cpp.
References llvm::MachineModuleInfo::addFrameInst(), llvm::MachineBasicBlock::begin(), llvm::BuildMI(), canUseRedZone(), llvm::TargetOpcode::CFI_INSTRUCTION, llvm::TargetInstrInfo::copyPhysReg(), llvm::MCCFIInstruction::createDefCfa(), llvm::MCCFIInstruction::createDefCfaOffset(), llvm::MCCFIInstruction::createOffset(), llvm::MCContext::CreateTempSymbol(), emitCalleeSavedFrameMoves(), llvm::emitFrameOffset(), llvm::MachineBasicBlock::findDebugLoc(), FramePtr, llvm::MachineInstr::FrameSetup, llvm::MachineFunction::front(), llvm::MCInstrInfo::get(), llvm::MachineModuleInfo::getContext(), llvm::TargetSubtargetInfo::getDataLayout(), llvm::MachineFunction::getFrameInfo(), llvm::AArch64RegisterInfo::getFrameRegister(), llvm::MachineFunction::getFunction(), llvm::MachineFunction::getInfo(), llvm::TargetSubtargetInfo::getInstrInfo(), llvm::MachineFunction::getMMI(), llvm::DataLayout::getPointerSize(), llvm::TargetSubtargetInfo::getRegisterInfo(), llvm::MachineFrameInfo::getStackSize(), llvm::MachineFunction::getSubtarget(), llvm::AArch64RegisterInfo::hasBasePointer(), llvm::MachineModuleInfo::hasDebugInfo(), hasFP(), llvm::AArch64FunctionInfo::hasStackFrame(), llvm::Function::needsUnwindTableEntry(), llvm::AArch64FunctionInfo::setLocalStackSize(), and TII.
int AArch64FrameLowering::getFrameIndexOffset | ( | const MachineFunction & | MF, |
int | FI | ||
) | const [override, virtual] |
getFrameIndexOffset - Returns the displacement from the frame register to the stack frame of the specified index.
Reimplemented from llvm::TargetFrameLowering.
Definition at line 530 of file AArch64FrameLowering.cpp.
References getFrameIndexReference().
int AArch64FrameLowering::getFrameIndexReference | ( | const MachineFunction & | MF, |
int | FI, | ||
unsigned & | FrameReg | ||
) | const [override, virtual] |
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 540 of file AArch64FrameLowering.cpp.
References resolveFrameIndexReference().
Referenced by getFrameIndexOffset().
bool AArch64FrameLowering::hasFP | ( | const MachineFunction & | MF | ) | const [override, virtual] |
hasFP - Return true if the specified function should have a dedicated frame pointer register.
Implements llvm::TargetFrameLowering.
Definition at line 85 of file AArch64FrameLowering.cpp.
References llvm::MachineFunction::getFrameInfo(), llvm::TargetSubtargetInfo::getRegisterInfo(), llvm::MachineFunction::getSubtarget(), llvm::MachineFrameInfo::hasCalls(), llvm::MachineFrameInfo::hasVarSizedObjects(), llvm::MachineFrameInfo::isFrameAddressTaken(), and llvm::TargetRegisterInfo::needsStackRealignment().
Referenced by canUseRedZone(), emitCalleeSavedFrameMoves(), emitEpilogue(), emitPrologue(), processFunctionBeforeCalleeSavedScan(), and resolveFrameIndexReference().
bool AArch64FrameLowering::hasReservedCallFrame | ( | const MachineFunction & | MF | ) | const [override, virtual] |
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.
Definition at line 104 of file AArch64FrameLowering.cpp.
References llvm::MachineFunction::getFrameInfo(), and llvm::MachineFrameInfo::hasVarSizedObjects().
void AArch64FrameLowering::processFunctionBeforeCalleeSavedScan | ( | MachineFunction & | MF, |
RegScavenger * | RS | ||
) | const [override, virtual] |
processFunctionBeforeCalleeSavedScan - This method is called immediately before PrologEpilogInserter scans the physical registers used to determine what callee saved registers should be spilled. This method is optional.
Reimplemented from llvm::TargetFrameLowering.
Definition at line 761 of file AArch64FrameLowering.cpp.
References llvm::RegScavenger::addScavengingFrameIndex(), llvm::SmallVectorTemplateCommon< T, typename >::back(), llvm::AArch64RegisterInfo::cannotEliminateFrame(), contains(), llvm::MachineFrameInfo::CreateStackObject(), llvm::dbgs(), DEBUG, llvm::SmallVectorBase::empty(), estimateStackSize(), llvm::TargetRegisterClass::getAlignment(), llvm::AArch64RegisterInfo::getBaseRegister(), llvm::AArch64RegisterInfo::getCalleeSavedRegs(), llvm::MachineFunction::getFrameInfo(), llvm::MachineFunction::getInfo(), llvm::MachineFunction::getRegInfo(), llvm::TargetSubtargetInfo::getRegisterInfo(), llvm::TargetRegisterClass::getSize(), llvm::MachineFunction::getSubtarget(), llvm::AArch64RegisterInfo::hasBasePointer(), hasFP(), llvm::AArch64RegisterInfo::isReservedReg(), llvm::SmallVectorTemplateBase< T, isPodLike >::pop_back(), llvm::SmallVectorTemplateBase< T, isPodLike >::push_back(), llvm::AArch64FunctionInfo::setHasStackFrame(), and llvm::SmallVectorTemplateCommon< T, typename >::size().
int AArch64FrameLowering::resolveFrameIndexReference | ( | const MachineFunction & | MF, |
int | FI, | ||
unsigned & | FrameReg, | ||
bool | PreferFP = false |
||
) | const |
Definition at line 546 of file AArch64FrameLowering.cpp.
References canUseRedZone(), llvm::AArch64RegisterInfo::getBaseRegister(), llvm::MachineFunction::getFrameInfo(), llvm::AArch64RegisterInfo::getFrameRegister(), llvm::MachineFunction::getInfo(), llvm::AArch64FunctionInfo::getLocalStackSize(), llvm::MachineFrameInfo::getObjectOffset(), llvm::TargetSubtargetInfo::getRegisterInfo(), llvm::MachineFrameInfo::getStackSize(), llvm::MachineFunction::getSubtarget(), llvm::AArch64RegisterInfo::hasBasePointer(), hasFP(), llvm::AArch64FunctionInfo::hasStackFrame(), llvm::MachineFrameInfo::hasVarSizedObjects(), and llvm::MachineFrameInfo::isFixedObjectIndex().
Referenced by llvm::AArch64RegisterInfo::eliminateFrameIndex(), and getFrameIndexReference().
bool AArch64FrameLowering::restoreCalleeSavedRegisters | ( | MachineBasicBlock & | MBB, |
MachineBasicBlock::iterator | MI, | ||
const std::vector< CalleeSavedInfo > & | CSI, | ||
const TargetRegisterInfo * | TRI | ||
) | const [override, virtual] |
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(). Returns false otherwise.
Reimplemented from llvm::TargetFrameLowering.
Definition at line 691 of file AArch64FrameLowering.cpp.
References llvm::MachineInstrBuilder::addImm(), llvm::MachineInstrBuilder::addReg(), llvm::BuildMI(), contains(), llvm::dbgs(), DEBUG, llvm::RegState::Define, llvm::MachineBasicBlock::end(), llvm::MCInstrInfo::get(), llvm::getDefRegState(), llvm::TargetSubtargetInfo::getInstrInfo(), llvm::MCRegisterInfo::getName(), llvm::MachineBasicBlock::getParent(), llvm::MachineFunction::getSubtarget(), llvm_unreachable, and TII.
bool AArch64FrameLowering::spillCalleeSavedRegisters | ( | MachineBasicBlock & | MBB, |
MachineBasicBlock::iterator | MI, | ||
const std::vector< CalleeSavedInfo > & | CSI, | ||
const TargetRegisterInfo * | TRI | ||
) | const [override, virtual] |
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.
Definition at line 615 of file AArch64FrameLowering.cpp.
References llvm::MachineInstrBuilder::addImm(), llvm::MachineInstrBuilder::addReg(), llvm::BuildMI(), contains(), llvm::dbgs(), DEBUG, llvm::RegState::Define, llvm::MachineBasicBlock::end(), llvm::MachineInstr::FrameSetup, llvm::MCInstrInfo::get(), llvm::TargetSubtargetInfo::getInstrInfo(), llvm::MCRegisterInfo::getName(), llvm::MachineBasicBlock::getParent(), getPrologueDeath(), llvm::MachineFunction::getSubtarget(), llvm_unreachable, llvm::MachineInstrBuilder::setMIFlag(), and TII.