LLVM: lib/Target/AArch64/AArch64FrameLowering.cpp File Reference (original) (raw)
Go to the source code of this file.
Macros | |
---|---|
#define | DEBUG_TYPE "frame-info" |
#define | CASE(n) |
#define | CASE(n) |
Variables | |
---|---|
static cl::opt< bool > | EnableRedZone ("aarch64-redzone", cl::desc("enable use of redzone on AArch64"), cl::init(false), cl::Hidden) |
static cl::opt< bool > | StackTaggingMergeSetTag ("stack-tagging-merge-settag", cl::desc("merge settag instruction in function epilog"), cl::init(true), cl::Hidden) |
static cl::opt< bool > | OrderFrameObjects ("aarch64-order-frame-objects", cl::desc("sort stack allocations"), cl::init(true), cl::Hidden) |
cl::opt< bool > | EnableHomogeneousPrologEpilog ("homogeneous-prolog-epilog", cl::Hidden, cl::desc("Emit homogeneous prologue and epilogue for the size " "optimization (default = off)")) |
static cl::opt< unsigned > | StackHazardRemarkSize ("aarch64-stack-hazard-remark-size", cl::init(0), cl::Hidden) |
static cl::opt< bool > | StackHazardInNonStreaming ("aarch64-stack-hazard-in-non-streaming", cl::init(false), cl::Hidden) |
static cl::opt< bool > | DisableMultiVectorSpillFill ("aarch64-disable-multivector-spill-fill", cl::desc("Disable use of LD/ST pairs for SME2 or SVE2p1"), cl::init(false), cl::Hidden) |
static const unsigned | DefaultSafeSPDisplacement = 255 |
This is the biggest offset to the stack pointer we can encode in aarch64 instructions (without using a separate calculation and a temp register). | |
◆ CASE [1/2]
Value:
case AArch64::W##n: \
case AArch64::X##n: \
return AArch64::X##n
◆ CASE [2/2]
Value:
case AArch64::B##n: \
case AArch64::H##n: \
case AArch64::S##n: \
case AArch64::D##n: \
case AArch64::Q##n: \
return HasSVE ? AArch64::Z##n : AArch64::Q##n
◆ DEBUG_TYPE
#define DEBUG_TYPE "frame-info"
◆ computeCalleeSaveRegisterPairs()
Definition at line 2966 of file AArch64FrameLowering.cpp.
References assert(), llvm::SmallVectorTemplateCommon< T, typename >::begin(), CC, contains(), llvm::CallingConv::CXX_FAST_TLS, llvm::ArrayRef< T >::empty(), llvm::SmallVectorTemplateCommon< T, typename >::end(), llvm::AArch64FunctionInfo::getCalleeSavedStackSize(), llvm::Function::getCallingConv(), llvm::MachineFunction::getFrameInfo(), llvm::MachineFunction::getFunction(), llvm::MachineFunction::getInfo(), llvm::MachineFrameInfo::getObjectAlign(), llvm::AArch64FunctionInfo::getPredicateRegForFillSpill(), getStackHazardSize(), llvm::AArch64FunctionInfo::getSVECalleeSavedStackSize(), llvm::AArch64FunctionInfo::hasCalleeSaveStackFreeSpace(), llvm::AArch64FunctionInfo::hasStackHazardSlotIndex(), llvm::AArch64FunctionInfo::hasSwiftAsyncContext(), invalidateRegisterPairing(), invalidateWindowsRegisterPairing(), llvm::AArch64InstrInfo::isFpOrNEON(), isTargetWindows(), llvm_unreachable, needsWinCFI(), llvm::Offset, llvm::CallingConv::PreserveAll, llvm::CallingConv::PreserveMost, produceCompactUnwindFrame(), llvm::SmallVectorTemplateBase< T, bool >::push_back(), llvm::AArch64FunctionInfo::setCalleeSaveBaseToFrameRecordOffset(), llvm::MachineFrameInfo::setObjectAlignment(), llvm::ArrayRef< T >::size(), TRI, and llvm::CallingConv::Win64.
Referenced by llvm::AArch64FrameLowering::restoreCalleeSavedRegisters(), and llvm::AArch64FrameLowering::spillCalleeSavedRegisters().
◆ convertCalleeSaveRestoreToSPPrePostIncDec()
Definition at line 1437 of file AArch64FrameLowering.cpp.
References llvm::MachineInstrBuilder::add(), llvm::MachineInstrBuilder::addCFIIndex(), llvm::MachineFunction::addFrameInst(), llvm::MachineInstrBuilder::addImm(), llvm::MachineInstrBuilder::addReg(), assert(), llvm::BuildMI(), llvm::MCCFIInstruction::cfiDefCfaOffset(), llvm::RegState::Define, DL, llvm::emitFrameOffset(), llvm::MachineBasicBlock::erase(), llvm::MachineInstr::FrameDestroy, llvm::StackOffset::getFixed(), llvm::TypeSize::getFixed(), llvm::details::FixedOrScalableQuantity< LeafTy, ValueTy >::getFixedValue(), llvm::MachineBasicBlock::getParent(), InsertSEH(), llvm::AArch64InstrInfo::isSEHInstruction(), isVGInstruction(), llvm_unreachable, MBB, MBBI, requiresSaveVG(), llvm::MachineInstrBuilder::setMemRefs(), llvm::MachineInstrBuilder::setMIFlags(), Success, and TII.
Referenced by llvm::AArch64FrameLowering::emitEpilogue(), and llvm::AArch64FrameLowering::emitPrologue().
◆ determineSVEStackObjectOffsets()
static int64_t determineSVEStackObjectOffsets ( MachineFrameInfo & MFI, int & MinCSFrameIndex, int & MaxCSFrameIndex, bool AssignOffsets ) | static |
---|
Definition at line 4070 of file AArch64FrameLowering.cpp.
References llvm::alignTo(), assert(), llvm::dbgs(), llvm::MachineFrameInfo::getObjectAlign(), llvm::MachineFrameInfo::getObjectIndexBegin(), llvm::MachineFrameInfo::getObjectIndexEnd(), llvm::MachineFrameInfo::getObjectSize(), llvm::MachineFrameInfo::getStackID(), llvm::MachineFrameInfo::getStackProtectorIndex(), getSVECalleeSaveSlotRange(), llvm::MachineFrameInfo::hasStackProtectorIndex(), I, llvm::MachineFrameInfo::isDeadObjectIndex(), LLVM_DEBUG, llvm::Offset, llvm::SmallVectorTemplateBase< T, bool >::push_back(), llvm::report_fatal_error(), llvm::TargetStackID::ScalableVector, and llvm::MachineFrameInfo::setObjectOffset().
◆ emitCalleeSavedRestores()
Definition at line 727 of file AArch64FrameLowering.cpp.
References llvm::MachineInstrBuilder::addCFIIndex(), llvm::MachineFunction::addFrameInst(), llvm::BuildMI(), llvm::MCCFIInstruction::createRestore(), DL, llvm::MachineBasicBlock::findDebugLoc(), llvm::MachineInstr::FrameDestroy, llvm::MachineFrameInfo::getCalleeSavedInfo(), llvm::MachineFunction::getFrameInfo(), llvm::TargetSubtargetInfo::getInstrInfo(), llvm::MachineBasicBlock::getParent(), llvm::TargetSubtargetInfo::getRegisterInfo(), llvm::MachineFrameInfo::getStackID(), llvm::MachineFunction::getSubtarget(), Info, MBB, MBBI, llvm::TargetStackID::ScalableVector, llvm::MachineInstrBuilder::setMIFlags(), llvm::SVE, TII, and TRI.
◆ emitDefineCFAWithFP()
Definition at line 1700 of file AArch64FrameLowering.cpp.
References llvm::MachineInstrBuilder::addCFIIndex(), llvm::MachineFunction::addFrameInst(), llvm::BuildMI(), llvm::MCCFIInstruction::cfiDefCfa(), DL, FramePtr, llvm::MachineInstr::FrameSetup, llvm::AArch64FunctionInfo::getCalleeSaveBaseToFrameRecordOffset(), llvm::AArch64FunctionInfo::getCalleeSavedStackSize(), llvm::MachineFunction::getInfo(), llvm::AArch64Subtarget::getInstrInfo(), llvm::AArch64Subtarget::getRegisterInfo(), llvm::MachineFunction::getSubtarget(), MBB, MBBI, llvm::MachineInstrBuilder::setMIFlags(), TII, and TRI.
Referenced by llvm::AArch64FrameLowering::emitPrologue().
◆ emitShadowCallStackEpilogue()
Definition at line 1677 of file AArch64FrameLowering.cpp.
References llvm::MachineInstrBuilder::addCFIIndex(), llvm::MachineFunction::addFrameInst(), llvm::MachineInstrBuilder::addImm(), llvm::MachineInstrBuilder::addReg(), llvm::BuildMI(), llvm::MCCFIInstruction::createRestore(), llvm::RegState::Define, DL, llvm::MachineInstr::FrameDestroy, llvm::MachineFunction::getInfo(), MBB, MBBI, llvm::AArch64FunctionInfo::needsAsyncDwarfUnwindInfo(), llvm::MachineInstrBuilder::setMIFlag(), llvm::MachineInstrBuilder::setMIFlags(), and TII.
Referenced by llvm::AArch64FrameLowering::emitEpilogue().
◆ emitShadowCallStackPrologue()
Definition at line 1638 of file AArch64FrameLowering.cpp.
References llvm::MachineInstrBuilder::addCFIIndex(), llvm::MachineFunction::addFrameInst(), llvm::MachineInstrBuilder::addImm(), llvm::MachineBasicBlock::addLiveIn(), llvm::MachineInstrBuilder::addReg(), llvm::BuildMI(), llvm::MCCFIInstruction::createEscape(), llvm::RegState::Define, DL, llvm::MachineInstr::FrameSetup, MBB, MBBI, llvm::MachineInstrBuilder::setMIFlag(), and TII.
Referenced by llvm::AArch64FrameLowering::emitPrologue().
◆ emitVGSaveRestore()
Definition at line 4644 of file AArch64FrameLowering.cpp.
References llvm::MachineInstrBuilder::addCFIIndex(), llvm::MachineFunction::addFrameInst(), assert(), llvm::BuildMI(), llvm::MCCFIInstruction::createOffset(), llvm::MCCFIInstruction::createRestore(), llvm::MachineFunction::getFrameInfo(), llvm::MachineFunction::getFunction(), llvm::MachineFunction::getInfo(), llvm::ilist_node_impl< OptionsT >::getIterator(), llvm::MachineFrameInfo::getObjectOffset(), llvm::TargetFrameLowering::getOffsetOfLocalArea(), llvm::MachineBasicBlock::getParent(), llvm::TargetSubtargetInfo::getRegisterInfo(), llvm::AArch64FunctionInfo::getStreamingVGIdx(), llvm::MachineFunction::getSubtarget(), llvm::AArch64FunctionInfo::getVGIdx(), llvm::SMEAttrs::hasStreamingBody(), llvm::SMEAttrs::hasStreamingInterface(), II, MBB, MI, llvm::Offset, TII, and TRI.
Referenced by llvm::AArch64FrameLowering::processFunctionBeforeFrameIndicesReplaced().
◆ enableMultiVectorSpillFill()
◆ estimateRSStackSizeLimit()
◆ findFreePredicateReg()
◆ findScratchNonCalleeSaveRegister()
Definition at line 1069 of file AArch64FrameLowering.cpp.
References llvm::LivePhysRegs::available(), llvm::MachineFunction::front(), llvm::Function::getCallingConv(), llvm::MachineFunction::getFunction(), getLiveRegsForEntryMBB(), llvm::MachineBasicBlock::getParent(), llvm::MachineFunction::getRegInfo(), llvm::AArch64Subtarget::getRegisterInfo(), llvm::MachineFunction::getSubtarget(), MBB, MRI, llvm::CallingConv::PreserveNone, and TRI.
Referenced by buildScratchExecCopy(), llvm::AArch64FrameLowering::canUseAsPrologue(), llvm::SIFrameLowering::emitEpilogue(), llvm::SIFrameLowering::emitPrologue(), and llvm::AArch64FrameLowering::spillCalleeSavedRegisters().
◆ fixupCalleeSaveRestoreStackOffset()
◆ fixupSEHOpcode()
◆ getArgumentStackToRestore()
◆ getFixedObjectSize()
Returns the size of the fixed object area (allocated next to sp on entry) On Win64 this may include a var args area and an UnwindHelp object for EH.
Definition at line 428 of file AArch64FrameLowering.cpp.
References llvm::alignTo(), llvm::Function::getAttributes(), llvm::MachineFunction::getFunction(), llvm::AArch64FunctionInfo::getTailCallReservedStack(), llvm::AArch64FunctionInfo::getVarArgsGPRSize(), llvm::AttributeList::hasAttrSomewhere(), llvm::MachineFunction::hasEHFunclets(), and llvm::report_fatal_error().
Referenced by llvm::AArch64FrameLowering::emitEpilogue(), llvm::AArch64FrameLowering::emitPrologue(), getFPOffset(), and llvm::AArch64FrameLowering::processFunctionBeforeFrameFinalized().
◆ getFPOffset()
◆ getLdStFrameID()
◆ getLivePhysRegsUpTo()
◆ getLiveRegsForEntryMBB()
◆ getMMOFrameID()
◆ getPrologueDeath()
◆ getRegisterOrZero()
◆ getStackHazardSize()
◆ getStackOffset()
◆ getSVECalleeSaveSlotRange()
◆ getSVEStackSize()
◆ insertCFISameValue()
◆ InsertSEH()
Definition at line 1231 of file AArch64FrameLowering.cpp.
References llvm::MachineInstrBuilder::addImm(), llvm::BuildMI(), DL, llvm::MachineBasicBlock::getParent(), llvm::AArch64Subtarget::getRegisterInfo(), llvm::MachineFunction::getSubtarget(), I, llvm::MachineBasicBlock::insertAfter(), llvm_unreachable, MBB, MBBI, llvm::MachineInstrBuilder::setMIFlag(), and TII.
Referenced by convertCalleeSaveRestoreToSPPrePostIncDec(), llvm::AArch64FrameLowering::restoreCalleeSavedRegisters(), and llvm::AArch64FrameLowering::spillCalleeSavedRegisters().
◆ invalidateRegisterPairing()
◆ invalidateWindowsRegisterPairing()
◆ isFuncletReturnInstr()
◆ IsSVECalleeSave()
◆ isTargetWindows()
◆ isVGInstruction()
◆ needsWinCFI()
Definition at line 1142 of file AArch64FrameLowering.cpp.
References F, llvm::MachineFunction::getFunction(), llvm::TargetMachine::getMCAsmInfo(), llvm::MachineFunction::getTarget(), and llvm::MCAsmInfo::usesWindowsCFI().
Referenced by llvm::AArch64FrameLowering::assignCalleeSavedSpillSlots(), computeCalleeSaveRegisterPairs(), llvm::AArch64FrameLowering::emitEpilogue(), llvm::AArch64FrameLowering::emitPrologue(), llvm::ARMFrameLowering::emitPrologue(), llvm::AArch64FrameLowering::restoreCalleeSavedRegisters(), and llvm::AArch64FrameLowering::spillCalleeSavedRegisters().
◆ operator<<()
◆ produceCompactUnwindFrame()
Definition at line 2861 of file AArch64FrameLowering.cpp.
References llvm::Function::getAttributes(), llvm::Function::getCallingConv(), llvm::MachineFunction::getFunction(), llvm::MachineFunction::getInfo(), llvm::MachineFunction::getSubtarget(), llvm::AArch64FunctionInfo::getSVECalleeSavedStackSize(), llvm::AArch64Subtarget::getTargetLowering(), llvm::AArch64Subtarget::isTargetMachO(), requiresSaveVG(), llvm::AArch64TargetLowering::supportSwiftError(), and llvm::CallingConv::SwiftTail.
Referenced by computeCalleeSaveRegisterPairs(), and llvm::AArch64FrameLowering::determineCalleeSaves().
◆ requiresGetVGCall()
◆ requiresSaveVG()
◆ STATISTIC()
STATISTIC | ( | NumRedZoneFunctions | , |
---|---|---|---|
"Number of functions using red zone" | |||
) |
◆ upperBound()
◆ windowsRequiresStackProbe()
◆ DefaultSafeSPDisplacement
◆ DisableMultiVectorSpillFill
cl::opt< bool > DisableMultiVectorSpillFill("aarch64-disable-multivector-spill-fill", cl::desc("Disable use of LD/ST pairs for SME2 or SVE2p1"), cl::init(false), cl::Hidden) ( "aarch64-disable-multivector-spill-fill" , cl::desc("Disable use of LD/ST pairs for SME2 or SVE2p1") , cl::init(false) , cl::Hidden ) | static |
---|
◆ EnableHomogeneousPrologEpilog
cl::opt< bool > EnableHomogeneousPrologEpilog("homogeneous-prolog-epilog", cl::Hidden, cl::desc("Emit homogeneous prologue and epilogue for the size " "optimization (default = off)")) | ( | "homogeneous-prolog-epilog" | , |
---|---|---|---|
cl::Hidden | , | ||
cl::desc("Emit homogeneous prologue and epilogue for the size " "optimization (default = off)") | |||
) |
◆ EnableRedZone
cl::opt< bool > EnableRedZone("aarch64-redzone", cl::desc("enable use of redzone on AArch64"), cl::init(false), cl::Hidden) ( "aarch64-redzone" , cl::desc("enable use of redzone on AArch64") , cl::init(false) , cl::Hidden ) | static |
---|
◆ OrderFrameObjects
cl::opt< bool > OrderFrameObjects("aarch64-order-frame-objects", cl::desc("sort stack allocations"), cl::init(true), cl::Hidden) ( "aarch64-order-frame-objects" , cl::desc("sort stack allocations") , cl::init(true) , cl::Hidden ) | static |
---|
◆ StackHazardInNonStreaming
cl::opt< bool > StackHazardInNonStreaming("aarch64-stack-hazard-in-non-streaming", cl::init(false), cl::Hidden) ( "aarch64-stack-hazard-in-non-streaming" , cl::init(false) , cl::Hidden ) | static |
---|
◆ StackHazardRemarkSize
cl::opt< unsigned > StackHazardRemarkSize("aarch64-stack-hazard-remark-size", cl::init(0), cl::Hidden) ( "aarch64-stack-hazard-remark-size" , cl::init(0) , cl::Hidden ) | static |
---|